:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-border: #dbe3ee;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #00b380;
    --accent-dark: #059669;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #b45309;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    overflow-y: auto;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 20mm;
    background: #00b380;
    color: #fff;
    margin: 0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.header-left a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    white-space: nowrap;
}

.header-link:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-link:active {
    transform: translateY(0);
}

.header-link-primary {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.header-link-primary:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.header-link-danger {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-link-danger:hover {
    background: rgba(255, 100, 100, 0.3);
    color: #ffffff;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #ffffff;
}

.auth-card {
    width: min(420px, 100%);
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    text-align: center;
}

.auth-card p {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin: 0 0 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #00b380;
    box-shadow: 0 0 0 3px rgba(0, 179, 128, 0.12);
}

.form-errors {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #dc2626;
    font-size: 12px;
}

.form-errors li {
    margin-top: 4px;
}

.forgot-password-link {
    align-self: flex-end;
    font-size: 12px;
    color: #00b380;
    text-decoration: none;
    margin-top: 4px;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* ── Модальное окно ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.modal-overlay--visible {
    display: flex;
}

.modal-box {
    position: relative;
    width: min(440px, 100%);
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    text-align: center;
    animation: modalPop 0.25s ease;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e6faf4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}

.modal-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    margin: 0 0 8px;
}

.modal-text strong {
    color: #00b380;
}

.modal-subtext {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 20px;
}

.modal-ok-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00b380, #059669);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-ok-btn:hover {
    opacity: 0.9;
}

.submit-btn {
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00b380, #059669);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:active {
    opacity: 0.8;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #64748b;
}

.auth-footer a {
    color: #00b380;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.non-field-errors {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Footer ── */
.site-footer {
    background-color: #26cd94;
    padding: 75px 0 90px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    align-items: start;
}

.footer-logo {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 16px;
    letter-spacing: 0.03em;
}

.footer-telegram {
    display: inline-block;
    line-height: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 13px;
    color: #ffffff;
    text-decoration: none;
    line-height: 1.4;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-legal p {
    font-size: 13px;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    header {
        padding: 10px 16px;
        gap: 12px;
    }

    .header-left a {
        font-size: 12px;
    }

    .header-link {
        font-size: 12px;
        padding: 6px 10px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-legal {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    header {
        padding: 8px 12px;
    }

    .header-left a {
        font-size: 11px;
    }

    .header-link {
        font-size: 12px;
        padding: 6px 8px;
    }

    .modal-box {
        padding: 24px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}