* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
}

.container {
    max-width: 820px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 { margin-bottom: 1.5rem; font-size: 1.6rem; }
h2 { margin-bottom: 1rem; font-size: 1.2rem; color: #555; }

.card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

label .optional {
    font-weight: normal;
    color: #888;
    font-size: 0.8rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.4rem 0;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.tpl-download {
    margin-left: auto;
    font-size: 0.8rem;
    color: #0066cc;
    text-decoration: none;
    white-space: nowrap;
}

.tpl-download:hover {
    text-decoration: underline;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4a90e2;
}

input.invalid, select.invalid, textarea.invalid {
    border-color: #e74c3c;
}

.field-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    display: none;
}

.field-error.visible { display: block; }

.template-block {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.template-block h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: #444;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn:hover { background: #357abd; }
.btn-success { background: #27ae60; }
.btn-success:hover { background: #1e8449; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; color: #4a90d9; border: 1px solid #4a90d9; }
.btn-outline:hover { background: #4a90d9; color: #fff; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-error { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }

/* Страница реквизитов заказчика */
.requisites dt {
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.requisites dd {
    margin-left: 0;
    font-size: 1rem;
}

.templates-list {
    list-style: none;
    margin-top: 0.5rem;
}

.templates-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

/* Страница акта */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .two-col { grid-template-columns: 1fr; }
}
