/* ==========================================================
   Auth theme – "Soundwave Light"
   Used by: login, forgot-password, reset-password
   Everything is scoped under .au-page / .au-* to avoid clashes
   with theme.css / app.css loaded by the guest layout.
   ========================================================== */

.au-page {
    --au-red: #e8383d;
    --au-red-dark: #c92a2f;
    --au-rose: #ff8a8e;
    --au-ink: #1b1f2a;
    --au-muted: #6b7280;
    --au-line: #e7e9ee;
    --au-bg: #fbf7f6;

    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    font-family: 'Inter', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--au-ink);
    background:
        radial-gradient(1200px 700px at 8% -10%, #ffe9e7 0%, transparent 60%),
        radial-gradient(900px 600px at 100% 110%, #fde4ea 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, var(--au-bg) 100%);
    isolation: isolate;
}

.au-page *,
.au-page *::before,
.au-page *::after {
    box-sizing: border-box;
}

/* ---------- Animated background (decorative, never clickable) ---------- */
.au-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.au-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
}

.au-blob--a {
    width: 460px; height: 460px;
    top: -140px; left: -120px;
    background: radial-gradient(circle at 30% 30%, #ffb3b5, #ff7a80 70%);
    animation: au-drift-a 22s ease-in-out infinite alternate;
}
.au-blob--b {
    width: 520px; height: 520px;
    bottom: -200px; right: -140px;
    background: radial-gradient(circle at 60% 40%, #ffd3c4, #ff9aa7 70%);
    animation: au-drift-b 26s ease-in-out infinite alternate;
}
.au-blob--c {
    width: 320px; height: 320px;
    top: 38%; left: 46%;
    background: radial-gradient(circle, #ffe0e3, #ffc2d1 75%);
    opacity: 0.45;
    animation: au-drift-c 30s ease-in-out infinite alternate;
}

@keyframes au-drift-a { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes au-drift-b { to { transform: translate(-160px, -80px) scale(1.1); } }
@keyframes au-drift-c { to { transform: translate(-120px, 60px) scale(0.9); } }

/* gentle sound waves at the bottom */
.au-waves {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 220px;
    opacity: 0.9;
}
.au-waves svg { width: 200%; height: 100%; display: block; }
.au-wave-1 { animation: au-wave 28s linear infinite; }
.au-wave-2 { animation: au-wave 40s linear infinite reverse; }
@keyframes au-wave { to { transform: translateX(-50%); } }
.au-wave-1 path { fill: rgba(232, 56, 61, 0.07); }
.au-wave-2 path { fill: rgba(255, 138, 142, 0.10); }

/* ---------- Card ---------- */
.au-shell {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 30px 70px -20px rgba(201, 42, 47, 0.25),
        0 10px 30px -10px rgba(27, 31, 42, 0.12);
    overflow: hidden;
    animation: au-card-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.au-shell--narrow { max-width: 520px; min-height: 0; }

@keyframes au-card-in {
    from { opacity: 0; transform: translateY(26px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Brand side ---------- */
.au-brand {
    position: relative;
    flex: 1.05;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(160deg, rgba(255, 241, 240, 0.9), rgba(255, 255, 255, 0.4));
    border-right: 1px solid var(--au-line);
    overflow: hidden;
}

.au-logo { display: inline-block; margin-bottom: 40px; }
.au-logo img { height: 46px; width: auto; display: block; }

.au-brand h1 {
    margin: 0 0 14px;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.8px;
    font-weight: 800;
    color: var(--au-ink);
}
.au-brand h1 span {
    background: linear-gradient(90deg, var(--au-red), #ff6a70, var(--au-red));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: au-shine-text 5s linear infinite;
}
@keyframes au-shine-text { to { background-position: 200% center; } }

.au-brand p {
    margin: 0 0 28px;
    max-width: 380px;
    color: var(--au-muted);
    font-size: 14.5px;
    line-height: 1.7;
}

/* equalizer bars – echoes the logo mark */
.au-eq {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 46px;
    margin-bottom: 26px;
}
.au-eq i {
    display: block;
    width: 7px;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--au-red), var(--au-rose));
    transform-origin: bottom;
    transform: scaleY(0.25);
    animation: au-eq 1.3s ease-in-out infinite;
}
.au-eq i:nth-child(1) { animation-delay: -0.2s; }
.au-eq i:nth-child(2) { animation-delay: -0.9s; }
.au-eq i:nth-child(3) { animation-delay: -0.5s; }
.au-eq i:nth-child(4) { animation-delay: -1.1s; }
.au-eq i:nth-child(5) { animation-delay: -0.35s; }
.au-eq i:nth-child(6) { animation-delay: -0.75s; }
.au-eq i:nth-child(7) { animation-delay: -0.05s; }
@keyframes au-eq {
    0%, 100% { transform: scaleY(0.25); }
    50%      { transform: scaleY(1); }
}

.au-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.au-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--au-line);
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    box-shadow: 0 4px 12px -6px rgba(27, 31, 42, 0.15);
    animation: au-float 5s ease-in-out infinite;
}
.au-chip:nth-child(2) { animation-delay: -1.6s; }
.au-chip:nth-child(3) { animation-delay: -3.2s; }
.au-chip i { color: var(--au-red); font-size: 13px; }
@keyframes au-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* ---------- Form side ---------- */
.au-form-side {
    flex: 1;
    padding: 52px 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.au-shell--narrow .au-form-side { padding: 44px 40px 36px; }

.au-narrow-logo { display: none; text-align: center; margin-bottom: 22px; }
.au-shell--narrow .au-narrow-logo { display: block; }
.au-narrow-logo img { height: 42px; width: auto; }

.au-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--au-ink);
}
.au-subtitle {
    margin: 0 0 26px;
    font-size: 14px;
    color: var(--au-muted);
    line-height: 1.6;
}

/* staggered entrance */
.au-reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: au-rise 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(0.25s + var(--i, 0) * 0.09s);
}
@keyframes au-rise { to { opacity: 1; transform: none; } }

/* ---------- Fields ---------- */
.au-field { position: relative; margin-bottom: 18px; }

.au-label {
    display: block;
    margin: 0 0 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
}

.au-control { position: relative; }

.au-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 46px 0 46px;
    background: #fff;
    border: 1.5px solid var(--au-line);
    border-radius: 14px;
    font: inherit;
    font-size: 14.5px;
    color: var(--au-ink);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.au-input::placeholder { color: #a3a9b5; }
.au-input:hover { border-color: #d6dae2; }
.au-input:focus {
    outline: none;
    border-color: var(--au-red);
    box-shadow: 0 0 0 4px rgba(232, 56, 61, 0.12);
}
.au-input.is-invalid { border-color: #ef4444; }

/* icons never intercept clicks – this was the "input not taking click" bug */
.au-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #9aa1ae;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s, transform 0.2s;
}
.au-control:focus-within .au-icon {
    color: var(--au-red);
    transform: translateY(-50%) scale(1.12);
}

.au-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 10px;
    color: #9aa1ae;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.au-toggle:hover { color: var(--au-red); background: rgba(232, 56, 61, 0.08); }
.au-toggle:focus-visible { outline: 2px solid var(--au-red); outline-offset: 1px; }

/* ---------- Row: remember / forgot ---------- */
.au-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
    font-size: 13px;
}
.au-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--au-muted);
    cursor: pointer;
    user-select: none;
}
.au-check input {
    width: 16px; height: 16px;
    accent-color: var(--au-red);
    cursor: pointer;
    margin: 0;
}
.au-link {
    color: var(--au-red);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.au-link:hover { color: var(--au-red-dark); text-decoration: underline; }

/* ---------- Button ---------- */
.au-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, var(--au-red) 0%, #f0575c 100%);
    box-shadow: 0 14px 28px -12px rgba(232, 56, 61, 0.65);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.au-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}
.au-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(232, 56, 61, 0.7); }
.au-btn:hover::after { animation: au-sweep 0.9s ease; }
.au-btn:active { transform: translateY(0); }
.au-btn:focus-visible { outline: 3px solid rgba(232, 56, 61, 0.35); outline-offset: 2px; }
.au-btn:disabled { cursor: wait; filter: saturate(0.8); opacity: 0.85; transform: none; }
.au-btn .au-btn-arrow { transition: transform 0.2s; }
.au-btn:hover .au-btn-arrow { transform: translateX(4px); }
@keyframes au-sweep { to { left: 140%; } }

.au-spin {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: au-rot 0.7s linear infinite;
}
@keyframes au-rot { to { transform: rotate(360deg); } }

.au-back { margin-top: 20px; text-align: center; font-size: 13.5px; }

/* ---------- Alerts ---------- */
.au-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
}
.au-alert ul { margin: 6px 0 0; padding-left: 18px; }
.au-alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.au-alert--ok    { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.au-shake { animation: au-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes au-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.au-foot { margin-top: 26px; text-align: center; font-size: 12px; color: #9aa1ae; }
.au-foot b { color: var(--au-red); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .au-shell { flex-direction: column; max-width: 520px; min-height: 0; }
    .au-brand { padding: 32px 30px 26px; border-right: 0; border-bottom: 1px solid var(--au-line); }
    .au-brand h1 { font-size: 26px; }
    .au-brand p, .au-chips { display: none; }
    .au-eq { height: 32px; margin-bottom: 0; }
    .au-logo { margin-bottom: 18px; }
    .au-form-side { padding: 32px 28px 30px; }
}
@media (max-width: 420px) {
    .au-page { padding: 12px; }
    .au-form-side, .au-shell--narrow .au-form-side { padding: 28px 20px 24px; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .au-page *, .au-page *::before, .au-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .au-reveal { opacity: 1; transform: none; }
}
