/* Auth pages (login / forgot / reset) — split-screen layout, themed to match the public site */

.auth-page {
    --bg: #0b1020;
    --bg-soft: #161D31;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #F8F8F8;
    --muted: #9aa3c0;
    --primary: #7367F0;
    --primary-2: #9E95F5;
    --accent: #22d3ee;
    --success: #34d399;
    --danger: #fb7185;
    --grad: linear-gradient(100deg, #7367F0, #9E95F5 45%, #22d3ee);
    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    background: var(--bg) !important;
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.auth-page h1,
.auth-page h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* Background orbs (same as the site) */
.auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.auth-orb--1 { width: 520px; height: 520px; background: #4338ca; top: -180px; left: -120px; animation: authDrift 16s ease-in-out infinite alternate; }
.auth-orb--2 { width: 460px; height: 460px; background: #0e7490; top: 30%; right: -180px; animation: authDrift 20s ease-in-out infinite alternate-reverse; }
.auth-orb--3 { width: 420px; height: 420px; background: #6d28d9; bottom: -160px; left: 30%; animation: authDrift 24s ease-in-out infinite alternate; }

@keyframes authDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, 40px) scale(1.12); }
}

.auth-split {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* Brand panel */
.auth-split__brand {
    position: relative;
    flex: 0 0 46%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    color: var(--text);
    overflow: hidden;
    border-right: 1px solid var(--border);
    background:
        radial-gradient(closest-side at 30% 35%, rgba(115, 103, 240, 0.22), transparent 80%),
        radial-gradient(closest-side at 75% 80%, rgba(34, 211, 238, 0.12), transparent 80%),
        rgba(255, 255, 255, 0.015);
}

.auth-split__brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
}

.auth-brand-mark img {
    height: 34px;
    width: auto;
    display: block;
}

.auth-brand-copy h1 {
    color: var(--text);
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 1rem;
}

.auth-brand-copy p {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 440px;
    margin-bottom: 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 0.95rem;
    transition: transform 0.25s ease;
}

.auth-features li:hover {
    transform: translateX(6px);
}

.auth-features .auth-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--primary-2);
    background: rgba(115, 103, 240, 0.14);
    border: 1px solid rgba(115, 103, 240, 0.3);
    transition: background 0.25s ease, transform 0.25s ease;
}

.auth-features li:hover .auth-feature-icon {
    background: rgba(115, 103, 240, 0.26);
    transform: scale(1.08);
}

.auth-brand-footer {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Floating shapes (parallax via JS) */
.auth-shapes {
    position: absolute;
    inset: 0;
    z-index: 0 !important;
    pointer-events: none;
}

.auth-shape {
    position: absolute;
    display: block;
    border-radius: 50%;
    transition: transform 0.25s ease-out;
}

.auth-shape::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    animation: authFloat 9s ease-in-out infinite;
}

.auth-shape--1 { width: 120px; height: 120px; top: 14%; right: 12%; }
.auth-shape--1::before { background: rgba(115, 103, 240, 0.16); border: 1px solid rgba(158, 149, 245, 0.25); }

.auth-shape--2 { width: 64px; height: 64px; bottom: 22%; right: 30%; }
.auth-shape--2::before { border: 2px solid rgba(34, 211, 238, 0.35); animation-delay: -3s; animation-duration: 11s; }

.auth-shape--3 { width: 14px; height: 14px; top: 38%; left: 8%; }
.auth-shape--3::before { background: var(--accent); box-shadow: 0 0 18px rgba(34, 211, 238, 0.7); animation-delay: -5s; animation-duration: 7s; }

.auth-shape--4 { width: 180px; height: 180px; bottom: -40px; right: -40px; border-radius: 40px; }
.auth-shape--4::before { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); animation: authSpin 30s linear infinite; }

@keyframes authFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-22px) scale(1.05); }
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
}

/* Rotating headline word */
.auth-rotator {
    position: relative;
    display: inline-block;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.auth-rotator.is-out {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(4px);
}

/* Preview card */
.auth-preview {
    width: 280px;
    padding: 1rem 1.1rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 31, 54, 0.94), rgba(13, 18, 36, 0.96));
    border: 1px solid var(--border-strong);
    box-shadow: 0 24px 60px rgba(3, 6, 20, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-preview__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.auth-preview__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: authPulse 1.8s infinite;
}

@keyframes authPulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.auth-preview__bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 70px;
}

.auth-preview__bars span {
    flex: 1;
    height: var(--h);
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #22d3ee, rgba(115, 103, 240, 0.55));
    transform-origin: bottom;
    animation: authBar 3.2s ease-in-out infinite;
}

.auth-preview__bars span:nth-child(2) { animation-delay: -0.4s; }
.auth-preview__bars span:nth-child(3) { animation-delay: -0.8s; }
.auth-preview__bars span:nth-child(4) { animation-delay: -1.2s; }
.auth-preview__bars span:nth-child(5) { animation-delay: -1.6s; }
.auth-preview__bars span:nth-child(6) { animation-delay: -2.0s; }
.auth-preview__bars span:nth-child(7) { animation-delay: -2.4s; }

@keyframes authBar {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(0.6); }
}

/* Form panel */
.auth-split__form {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-back-link {
    position: absolute;
    top: 1.75rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: var(--text);
    text-decoration: none;
}

.auth-form-card {
    width: 100%;
    max-width: 430px;
    border-radius: 22px;
    padding: 2.5rem 2.25rem;
    background: linear-gradient(180deg, rgba(24, 31, 54, 0.85), rgba(13, 18, 36, 0.9));
    border: 1px solid var(--border-strong);
    box-shadow: 0 20px 60px rgba(3, 6, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.auth-form-card .auth-mobile-logo {
    display: none;
    margin-bottom: 1.75rem;
}

.auth-form-card .auth-mobile-logo img {
    height: 30px;
    width: auto;
}

.auth-form-card .card-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.auth-form-card .card-text {
    color: var(--muted);
    margin-bottom: 1.75rem;
}

.auth-form-card a {
    color: var(--primary-2);
}

.auth-form-card a:hover {
    color: var(--accent);
    text-decoration: none;
}

.auth-form-card .form-group {
    margin-bottom: 1.25rem;
}

.auth-form-card label,
.auth-form-card .custom-control-label {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.auth-form-card .form-group.is-focused label {
    color: var(--primary-2);
}

/* Inputs */
.auth-form-card .form-control,
.auth-form-card .input-group-text {
    height: 2.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form-card .form-control {
    border-radius: 12px;
}

.auth-form-card .form-control::placeholder {
    color: rgba(154, 163, 192, 0.6);
}

/* Autofill: keep a dark fill in every state — the :focus box-shadow below would
   otherwise replace the inset and expose the browser's light autofill bg. */
.auth-form-card .form-control:-webkit-autofill,
.auth-form-card .form-control:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #151b2f inset;
    box-shadow: 0 0 0 1000px #151b2f inset;
    caret-color: var(--text);
    transition: background-color 9999s ease-out 0s;
}

.auth-form-card .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #1a2038 inset, 0 0 0 4px rgba(115, 103, 240, 0.18);
    box-shadow: 0 0 0 1000px #1a2038 inset, 0 0 0 4px rgba(115, 103, 240, 0.18);
    caret-color: var(--text);
}

.auth-form-card .input-group-merge:focus-within .form-control:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #1a2038 inset;
    box-shadow: 0 0 0 1000px #1a2038 inset;
}

.auth-form-card .input-group-merge .form-control {
    border-radius: 12px 0 0 12px;
    border-right: 0;
}

.auth-form-card .input-group-merge .input-group-text {
    color: var(--muted);
    border-radius: 0 12px 12px 0;
    border-left: 0;
}

.auth-form-card .form-control:hover {
    border-color: rgba(158, 149, 245, 0.5);
}

.auth-form-card .form-control:focus {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(115, 103, 240, 0.18);
}

.auth-form-card .input-group-merge:focus-within .form-control,
.auth-form-card .input-group-merge:focus-within .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: none;
}

.auth-form-card .input-group-merge:focus-within {
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(115, 103, 240, 0.18);
}

.auth-form-card .is-invalid,
.auth-form-card .form-control.error {
    border-color: var(--danger) !important;
    animation: authShake 0.4s ease;
}

.auth-form-card .invalid-feedback,
.auth-form-card label.error {
    color: var(--danger);
}

@keyframes authShake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Checkbox */
.auth-form-card .custom-control-label::before {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
}

.auth-form-card .custom-control-input:checked ~ .custom-control-label::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.45);
}

/* Alerts */
.auth-form-card .alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    animation: authReveal 0.5s ease both;
}

.auth-form-card .alert-success {
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.auth-form-card .alert-danger {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
}

/* Submit button */
.auth-form-card .btn-primary,
.auth-submit {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    border: 0 !important;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff !important;
    background: var(--grad) !important;
    box-shadow: 0 10px 28px rgba(115, 103, 240, 0.4) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.auth-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(115, 103, 240, 0.55) !important;
}

.auth-submit:hover::after {
    animation: authShine 0.8s ease;
}

.auth-submit:active {
    transform: translateY(0);
}

@keyframes authShine {
    to { left: 125%; }
}

.auth-submit__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-submit__label svg {
    transition: transform 0.25s ease;
}

.auth-submit:hover .auth-submit__label svg {
    transform: translateX(4px);
}

.auth-submit__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

.auth-submit.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.auth-submit.is-loading .auth-submit__label { display: none; }
.auth-submit.is-loading .auth-submit__spinner { display: inline-block; }

/* Ripple */
.auth-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: authRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes authRipple {
    to { transform: scale(4); opacity: 0; }
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.auth-secure-note svg {
    color: var(--success);
}

.auth-form-footer {
    margin-top: 1.75rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Waving hand */
.auth-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: authWave 2.4s ease-in-out 1s 2;
}

@keyframes authWave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30%      { transform: rotate(14deg); }
    20%           { transform: rotate(-8deg); }
    40%           { transform: rotate(-4deg); }
    50%           { transform: rotate(10deg); }
}

/* Staggered entrance */
.auth-reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: authReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d, 0s);
}

@keyframes authReveal {
    to { opacity: 1; transform: none; }
}

.auth-card-enter {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    animation: authReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.auth-card-enter > * {
    opacity: 0;
    animation: authReveal 0.6s ease forwards;
}

.auth-card-enter > *:nth-child(1) { animation-delay: 0.30s; }
.auth-card-enter > *:nth-child(2) { animation-delay: 0.38s; }
.auth-card-enter > *:nth-child(3) { animation-delay: 0.46s; }
.auth-card-enter > *:nth-child(4) { animation-delay: 0.54s; }
.auth-card-enter > *:nth-child(n+5) { animation-delay: 0.62s; }

@media (max-width: 991.98px) {
    .auth-split__brand {
        display: none;
    }

    .auth-form-card .auth-mobile-logo {
        display: block;
    }

    .auth-back-link {
        top: 1.25rem;
        right: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .auth-split__form {
        padding: 4.5rem 1rem 2rem;
    }

    .auth-form-card {
        padding: 2rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orb,
    .auth-shape::before,
    .auth-preview__bars span,
    .auth-preview__dot,
    .auth-wave {
        animation: none !important;
    }

    .auth-reveal,
    .auth-card-enter,
    .auth-card-enter > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
