/* Auth pages — deep-water theme with animated wave background. */

.auth-body {
    min-height: 100dvh;
    background:
        radial-gradient(900px 460px at 82% -8%, rgba(94, 234, 212, .16), transparent 62%),
        radial-gradient(720px 420px at 8% 108%, rgba(45, 212, 191, .14), transparent 60%),
        linear-gradient(165deg, #063d3a 0%, #0a564f 48%, #0f766e 100%);
    color: #e9fbf7;
    overflow-x: hidden;
}

.auth-page {
    position: relative;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 48px 16px 220px;
    isolation: isolate;
}

/* ---------- decorative waves ---------- */

.auth-waves {
    position: fixed;
    inset: auto 0 0 0;
    height: 230px;
    z-index: 0;
    pointer-events: none;
}

.auth-waves .wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    will-change: transform;
}

.auth-waves .wave-1 {
    fill: rgba(167, 232, 224, .18);
    animation: auth-wave-drift 26s linear infinite;
}

.auth-waves .wave-2 {
    fill: rgba(94, 201, 189, .30);
    bottom: -26px;
    animation: auth-wave-drift 17s linear infinite reverse;
}

.auth-waves .wave-3 {
    fill: rgba(233, 251, 247, .34);
    bottom: -52px;
    animation: auth-wave-drift 11s linear infinite;
}

@keyframes auth-wave-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-waves .wave { animation: none; }
}

/* ---------- card ---------- */

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 410px;
    padding: 30px 28px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 18px;
    box-shadow: 0 24px 60px -18px rgba(4, 36, 34, .55);
    color: var(--sona-text, #16202b);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-brand .brand-logo {
    width: 112px;
    height: 112px;
    padding: 4px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 24px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 26px -14px rgba(15, 118, 110, .45);
}

.auth-brand .brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand strong { font-size: 19px; }
.auth-brand small { color: var(--sona-muted, #6b7a8c); margin-top: 2px; }

.auth-card__title { font-size: 21px; font-weight: 800; margin-bottom: 5px; text-align: center; }
.auth-card__sub { color: var(--sona-muted, #6b7a8c); font-size: 13px; margin-bottom: 20px; text-align: center; }
.auth-card .form-grid { gap: 15px; }
.auth-card .btn { width: 100%; margin-top: 6px; }

/* Teal identity on the auth page (matches the water theme, not the in-app orange). */
.auth-card .btn-primary {
    background: linear-gradient(145deg, #0f766e, #14b8a6);
    box-shadow: 0 10px 22px -8px rgba(20, 184, 166, .6);
}
.auth-card .btn-primary:hover { background: linear-gradient(145deg, #0f766e, #14b8a6); }
.auth-card .input:focus,
.auth-card .select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3.5px rgba(20, 184, 166, .18);
}
.auth-card a:focus-visible,
.auth-card button:focus-visible,
.auth-card input:focus-visible,
.auth-card select:focus-visible {
    outline: 2px solid #14b8a6;
}

.auth-alert {
    padding: 11px 13px;
    margin-bottom: 15px;
    border: 1px solid rgba(220, 38, 38, .25);
    border-radius: 11px;
    background: rgba(254, 226, 226, .92);
    color: #b91c1c;
    font-size: 13px;
}

.auth-alert--warn {
    border-color: rgba(217, 119, 6, .3);
    background: rgba(254, 243, 199, .92);
    color: #92400e;
}

.auth-foot { text-align: center; color: var(--sona-muted, #6b7a8c); font-size: 11px; margin-top: 20px; }

/* Mobile: dedicated full-screen layout — card runs edge to edge, brand at top,
   form centered in the remaining space, waves washing the bottom edge (no empty bands).
   Kept last so the media query wins over the base rules above. */
@media (max-width: 640px) {
    .auth-page {
        padding: 0;
        place-items: stretch;
    }

    .auth-card {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        padding: 22px 22px 14px;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .auth-brand { margin-bottom: 22px; }
    .auth-brand .brand-logo { width: 96px; height: 96px; border-radius: 20px; }
    .auth-brand strong { font-size: 19px; }
    .auth-card__title { font-size: 24px; }
    .auth-card__sub { font-size: 14px; margin-bottom: 20px; }

    /* Touch-sized controls; 16px inputs prevent iOS focus auto-zoom. */
    .auth-card .field-label { font-size: 14px; }
    .auth-card .input {
        font-size: 16px;
        padding: 13px 16px;
        border-radius: 14px;
    }
    .auth-card .btn {
        height: auto;
        padding: 15px 18px;
        font-size: 16px;
        border-radius: 14px;
        margin-top: 10px;
    }
    .auth-card .form-grid { margin-top: 0; gap: 18px; }
    .auth-foot { margin-top: auto; position: relative; z-index: 3; padding-top: 26px; font-size: 12px; color: #0f766e; }

    /* Waves overlay the card's bottom edge and stay visible on the white surface. */
    .auth-waves { z-index: 2; height: 130px; }
    .auth-waves .wave-1 { fill: rgba(15, 118, 110, .10); }
    .auth-waves .wave-2 { fill: rgba(20, 184, 166, .20); }
    .auth-waves .wave-3 { fill: rgba(13, 148, 136, .30); }
}

@media (max-width: 480px) {
    .auth-card { padding: 20px 18px 12px; }
}
