/* Site-wide login and signup overlay */

body.auth-modal-open {
    overflow: hidden;
}

.site-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    place-items: center;
    padding: 28px 18px;
    background: rgba(17, 24, 39, 0.62);
    backdrop-filter: blur(2px);
}

.site-auth-overlay.active {
    display: grid;
}

.site-auth-dialog {
    width: min(580px, calc(100vw - 48px));
    max-height: calc(100svh - 56px);
    overflow-y: auto;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.site-auth-card {
    padding: 32px 36px 30px;
}

.site-auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.site-auth-back,
.site-auth-close {
    border: 0;
    background: transparent;
    color: #171e26;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.site-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
}

.site-auth-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.45rem;
}

.site-auth-close:hover,
.site-auth-back:hover {
    background: #f3f6fa;
}

.site-auth-panel {
    display: none;
}

.site-auth-panel.active {
    display: block;
}

.site-auth-header {
    margin-bottom: 10px;
}

.site-auth-header h2 {
    margin: 0 0 10px;
    color: #171e26;
    font-size: clamp(1.9rem, 3vw, 2.35rem);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: 0;
}

.site-auth-header h2 span {
    color: #ff5a1f;
}

.site-auth-header p,
.site-auth-benefits,
.site-auth-form small,
.site-auth-footer {
    color: #35404c;
}

.site-auth-header p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.site-auth-benefits {
    margin: 14px 0 20px 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.site-auth-benefits li + li {
    margin-top: 3px;
}

.site-auth-social {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.site-auth-social button,
.site-auth-form button[type="submit"] {
    min-height: 44px;
    border-radius: 9px;
    font-weight: 900;
    cursor: pointer;
}

.site-auth-social button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid #171e26;
    background: #fff;
    color: #171e26;
    font-size: 0.95rem;
}

.site-auth-social button:hover {
    background: #f8fafc;
}

.site-auth-social .fa-google {
    color: #4285f4;
}

.site-auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 14px;
    color: #667382;
    font-size: 0.95rem;
}

.site-auth-divider::before,
.site-auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #d5dde7;
}

.site-auth-alert {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 0.88rem;
}

.site-auth-alert.alert-success {
    display: flex;
    background: #dcfce7;
    color: #166534;
}

.site-auth-alert.alert-error {
    display: flex;
    background: #fee2e2;
    color: #991b1b;
}

.site-auth-alert.alert-info {
    display: flex;
    background: #e0f2fe;
    color: #075985;
}

.site-auth-form,
.site-auth-step {
    margin: 0;
}

.site-auth-step {
    display: none;
}

.site-auth-step.active {
    display: block;
}

.site-auth-field {
    margin-bottom: 12px;
}

.site-auth-field label {
    display: block;
    margin-bottom: 7px;
    color: #171e26;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.site-auth-field label i {
    color: #0f6bff;
    margin-right: 6px;
}

.site-auth-field input {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid #d5dde7;
    border-radius: 8px;
    padding: 0 16px;
    color: #171e26;
    font-size: 0.98rem;
    font-weight: 700;
}

.site-auth-field input:focus {
    outline: none;
    border-color: #171e26;
    box-shadow: 0 0 0 4px rgba(15, 107, 255, 0.1);
}

.site-auth-field small {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
}

.site-auth-form button[type="submit"] {
    width: 100%;
    border: 0;
    background: linear-gradient(135deg, #ff6b1a, #ef2f21);
    color: #fff;
    font-size: 0.98rem;
}

.site-auth-form button[type="submit"]:disabled,
.site-auth-link-button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.site-auth-code-intro h3 {
    margin: 0 0 8px;
    color: #171e26;
    font-size: 1.45rem;
    line-height: 1.12;
    font-weight: 950;
}

.site-auth-code-intro p {
    margin: 0;
    color: #35404c;
    font-size: 0.9rem;
    line-height: 1.4;
}

.site-auth-code-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.site-auth-code-inputs input {
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
    border: 2px solid #a8b4c0;
    border-radius: 8px;
    background: #f8fafc;
    color: #171e26;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
}

.site-auth-resend {
    margin: 12px 0 0;
    color: #35404c;
    font-size: 0.86rem;
    line-height: 1.4;
}

.site-auth-link-button {
    border: 0;
    background: transparent;
    color: #0077a3;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0;
}

.site-auth-verified {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    background: #f0fdf4;
    color: #166534;
    padding: 11px 14px;
    font-size: 0.9rem;
    font-weight: 900;
}

.site-auth-footer {
    margin-top: 14px;
    text-align: center;
    font-size: 0.86rem;
    line-height: 1.45;
}

.site-auth-footer p {
    margin: 8px 0 0;
}

.site-auth-footer a,
.site-auth-footer button {
    color: #0077a3;
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 768px) {
    .site-auth-overlay {
        padding: 20px 14px;
    }

    .site-auth-dialog {
        width: min(330px, calc(100vw - 28px));
        max-height: calc(100svh - 40px);
        border-radius: 18px;
    }

    .site-auth-card {
        padding: 18px;
    }

    .site-auth-actions {
        margin-bottom: 12px;
    }

    .site-auth-header h2 {
        font-size: 1.48rem;
    }

    .site-auth-header p,
    .site-auth-benefits {
        font-size: 0.8rem;
    }

    .site-auth-benefits {
        margin: 10px 0 14px 18px;
    }

    .site-auth-social {
        grid-template-columns: 1fr;
    }

    .site-auth-field input,
    .site-auth-social button,
    .site-auth-form button[type="submit"] {
        min-height: 44px;
    }
}
