:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-soft: #fbfaf7;
    --line: #ded8cc;
    --line-strong: #c9bda9;
    --text: #211f1b;
    --muted: #6f675c;
    --primary: #c94f24;
    --primary-strong: #9f3718;
    --accent: #2f7d6d;
    --danger: #b42318;
    --success: #237a42;
    --focus: rgba(201, 79, 36, 0.22);
    --radius: 8px;
    --shadow: 0 18px 42px rgba(54, 43, 29, 0.12);
}

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

body {
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 244, 239, 0.96)),
        var(--bg);
    color: var(--text);
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

.background-globes {
    display: none;
}

.container {
    width: min(100%, 980px);
    margin: 0 auto;
}

.glass-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 28px;
}

#auth-container {
    max-width: 440px;
    margin: 8vh auto 0;
}

.logo-area {
    margin-bottom: 24px;
    text-align: center;
}

.logo-area h1 {
    color: var(--text);
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0;
}

.logo-area p,
.auth-helper {
    color: var(--muted);
}

.highlight {
    color: var(--primary);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

section {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

section:last-child {
    border-bottom: 0;
}

h3 {
    margin-bottom: 16px;
    color: var(--primary-strong);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    padding: 11px 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
    min-height: 108px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--focus);
}

.disabled-input {
    background: #ece7dd;
    color: var(--muted);
    cursor: not-allowed;
}

.grid-2,
.grid-3 {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin-bottom: 16px;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    color: var(--text);
}

button {
    min-height: 44px;
    font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-text {
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    transition: transform 140ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
    width: 100%;
    border: 0;
    background: var(--primary);
    color: #ffffff;
    padding: 12px 16px;
}

.btn-primary:hover {
    background: var(--primary-strong);
}

.btn-secondary {
    border: 1px solid var(--primary);
    background: #fff7f2;
    color: var(--primary-strong);
    padding: 10px 14px;
}

.btn-secondary:hover {
    background: #ffe8dc;
}

.btn-text {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 10px 12px;
}

.btn-text:hover {
    color: var(--danger);
    background: #fff2f0;
}

button:active {
    transform: translateY(1px);
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 220ms ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback {
    min-height: 24px;
    margin-top: 12px;
    text-align: center;
    font-weight: 700;
}

.feedback.success {
    color: var(--success);
}

.feedback.error {
    color: var(--danger);
}

.children-panel {
    margin-top: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffaf4;
}

.children-header,
.child-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.children-header {
    margin-bottom: 16px;
}

.children-header h4 {
    margin-bottom: 2px;
    font-size: 1.05rem;
}

.children-header p,
.child-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.child-form {
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.child-actions,
.child-card-actions {
    display: flex;
    gap: 10px;
}

.child-actions {
    align-items: flex-end;
    padding-bottom: 16px;
}

.child-card {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.child-card strong {
    display: block;
    margin-bottom: 2px;
}

.auth-helper {
    margin-top: 14px;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 760px) {
    body {
        padding: 12px;
    }

    .glass-card {
        padding: 20px;
    }

    header,
    .children-header,
    .child-card,
    .child-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
}
