/* ==========================================================================
   WebStackRank — Auth pages (login + register)
   Split-screen layout, animated hero orbs, floating labels, password toggle.
   Scoped to .wsr-auth so it cannot leak into the rest of the site.
   ========================================================================== */

.wsr-auth {
    --auth-radius: 18px;
    --auth-field-radius: 12px;
    --auth-bg: var(--wsr-bg, #0a0a0f);
    --auth-surface: var(--wsr-surface, #14141d);
    --auth-surface-2: var(--wsr-surface-2, #1c1c28);
    --auth-border: var(--wsr-border, #2a2a3a);
    --auth-border-strong: #3a3a4d;
    --auth-text: var(--wsr-text, #f1f1f5);
    --auth-muted: var(--wsr-muted, #9a9aab);
    --auth-yellow: var(--wsr-yellow, #ffb800);
    --auth-yellow-2: #ffd166;
    --auth-danger: #f85149;

    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

/* ----------------------------------- HERO ----------------------------------- */
.wsr-auth__hero {
    position: relative;
    padding: 3rem 3.25rem;
    background:
        radial-gradient(1100px 700px at 20% 0%, rgba(255, 184, 0, .14), transparent 60%),
        radial-gradient(900px 700px at 100% 100%, rgba(91, 76, 255, .18), transparent 65%),
        linear-gradient(160deg, #0c0c14 0%, #14141d 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    isolation: isolate;
}

/* Animated gradient orbs */
.wsr-auth__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: .55;
    z-index: 0;
    pointer-events: none;
    will-change: transform, opacity;
}
.wsr-auth__orb--yellow {
    width: 380px; height: 380px;
    top: -60px; left: -80px;
    background: radial-gradient(circle, rgba(255, 184, 0, .55) 0%, rgba(255, 184, 0, 0) 70%);
    animation: wsrOrbPulseA 9s ease-in-out infinite;
}
.wsr-auth__orb--violet {
    width: 460px; height: 460px;
    bottom: -120px; right: -140px;
    background: radial-gradient(circle, rgba(167, 139, 250, .45) 0%, rgba(167, 139, 250, 0) 70%);
    animation: wsrOrbPulseB 12s ease-in-out infinite;
}
.wsr-auth__orb--teal {
    width: 280px; height: 280px;
    top: 55%; left: 35%;
    background: radial-gradient(circle, rgba(56, 189, 248, .35) 0%, rgba(56, 189, 248, 0) 70%);
    animation: wsrOrbPulseA 14s ease-in-out infinite -3s;
}

@keyframes wsrOrbPulseA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .55; }
    50%      { transform: translate3d(20px, -30px, 0) scale(1.08); opacity: .75; }
}
@keyframes wsrOrbPulseB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .5; }
    50%      { transform: translate3d(-30px, 20px, 0) scale(1.1); opacity: .7; }
}

/* Hero content (above orbs) */
.wsr-auth__hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 2rem;
}

.wsr-auth__brand {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--auth-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.wsr-auth__brand span { color: var(--auth-yellow); }

.wsr-auth__tagline {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.025em;
    margin: 0;
    max-width: 26ch;
    background: linear-gradient(90deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wsr-auth__tagline-accent {
    background: linear-gradient(90deg, var(--auth-yellow), var(--auth-yellow-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wsr-auth__lede {
    color: var(--auth-muted);
    font-size: 1.02rem;
    line-height: 1.6;
    max-width: 42ch;
    margin: 1rem 0 0;
}

.wsr-auth__trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.wsr-auth__trust li {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--auth-text);
    font-size: .95rem;
    font-weight: 500;
}
.wsr-auth__trust .bi {
    color: var(--auth-yellow);
    background: rgba(255, 184, 0, .12);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.wsr-auth__hero-foot {
    color: var(--auth-muted);
    font-size: .8rem;
    margin: 0;
}

/* ----------------------------------- CARD ----------------------------------- */
.wsr-auth__card-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--auth-bg);
    overflow-y: auto;
}
.wsr-auth__card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 2.25rem 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .03) inset,
        0 20px 50px rgba(0, 0, 0, .45);
    animation: wsrCardIn .55s cubic-bezier(.16, 1, .3, 1);
}
.wsr-auth__card--wide { max-width: 520px; }

@keyframes wsrCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wsr-auth__title {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0 0 .4rem;
    letter-spacing: -.02em;
    color: var(--auth-text);
}
.wsr-auth__subtitle {
    color: var(--auth-muted);
    font-size: .92rem;
    margin: 0 0 1.5rem;
}

/* Google OAuth button */
.wsr-auth__google {
    width: 100%;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: var(--auth-field-radius);
    padding: .75rem 1rem;
    font-weight: 600;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    cursor: pointer;
    text-decoration: none;
}
.wsr-auth__google:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    background: #f9fafb;
    color: #1f2937;
}
.wsr-auth__google:disabled,
.wsr-auth__google.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.wsr-auth__google svg { width: 18px; height: 18px; }

/* Divider with "or" */
.wsr-auth__divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: var(--auth-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin: 1.25rem 0;
}
.wsr-auth__divider::before,
.wsr-auth__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* ----------------------------------- FIELDS ----------------------------------- */
.wsr-auth__field {
    position: relative;
    margin-bottom: 1.05rem;
    opacity: 0;
    transform: translateY(8px);
    animation: wsrFieldIn .5s ease forwards;
}
.wsr-auth__field--inline { display: flex; align-items: center; gap: .5rem; }

@keyframes wsrFieldIn {
    to { opacity: 1; transform: translateY(0); }
}
/* Staggered entrance — up to 10 fields */
.wsr-auth__card .wsr-auth__field:nth-of-type(1) { animation-delay: .05s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(2) { animation-delay: .10s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(3) { animation-delay: .15s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(4) { animation-delay: .20s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(5) { animation-delay: .25s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(6) { animation-delay: .30s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(7) { animation-delay: .35s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(8) { animation-delay: .40s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(9) { animation-delay: .45s; }
.wsr-auth__card .wsr-auth__field:nth-of-type(10) { animation-delay: .50s; }

/* Floating-label input */
.wsr-auth__input,
.wsr-auth__select {
    width: 100%;
    background: var(--auth-surface-2);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-field-radius);
    color: var(--auth-text);
    font-size: .95rem;
    padding: 1.25rem .9rem .5rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    outline: 0;
    line-height: 1.25;
    -webkit-appearance: none;
    appearance: none;
}
.wsr-auth__select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--auth-muted) 50%),
        linear-gradient(135deg, var(--auth-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2rem;
}
.wsr-auth__input:focus,
.wsr-auth__select:focus {
    border-color: var(--auth-yellow);
    box-shadow: 0 0 0 4px rgba(255, 184, 0, .14);
    background: var(--auth-surface-2);
}
.wsr-auth__input::placeholder { color: transparent; }

.wsr-auth__label {
    position: absolute;
    top: .85rem;
    left: .95rem;
    color: var(--auth-muted);
    font-size: .92rem;
    pointer-events: none;
    transition: transform .15s ease, color .15s ease, font-size .15s ease, top .15s ease;
    background: transparent;
    padding: 0 .15rem;
}
.wsr-auth__input:focus + .wsr-auth__label,
.wsr-auth__input:not(:placeholder-shown) + .wsr-auth__label,
.wsr-auth__select:focus + .wsr-auth__label,
.wsr-auth__select.has-value + .wsr-auth__label,
.wsr-auth__select:valid + .wsr-auth__label {
    top: .25rem;
    font-size: .68rem;
    color: var(--auth-yellow);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Password show/hide toggle */
.wsr-auth__pw-toggle {
    position: absolute;
    top: 50%;
    right: .55rem;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--auth-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.wsr-auth__pw-toggle:hover {
    color: var(--auth-yellow);
    background: rgba(255, 184, 0, .08);
}

/* Checkboxes (remember / terms) */
.wsr-auth__check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: .25rem 0 1.1rem;
    color: var(--auth-muted);
    font-size: .85rem;
    cursor: pointer;
    user-select: none;
}
.wsr-auth__check input[type="checkbox"] {
    width: 16px; height: 16px;
    margin-top: 2px;
    accent-color: var(--auth-yellow);
    flex-shrink: 0;
    cursor: pointer;
}
.wsr-auth__check a { color: var(--auth-yellow); }

.wsr-auth__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: .25rem 0 1.1rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.wsr-auth__row a { color: var(--auth-muted); font-size: .82rem; text-decoration: none; }
.wsr-auth__row a:hover { color: var(--auth-yellow); }

/* Submit button */
.wsr-auth__submit {
    width: 100%;
    padding: .9rem 1rem;
    border: 0;
    border-radius: var(--auth-field-radius);
    background: linear-gradient(135deg, var(--auth-yellow), var(--auth-yellow-2));
    color: #1a1d24;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 8px 22px rgba(255, 184, 0, .25);
}
.wsr-auth__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(255, 184, 0, .35);
    filter: brightness(1.04);
}
.wsr-auth__submit:active { transform: translateY(0); }

/* Card footer link */
.wsr-auth__foot {
    text-align: center;
    margin: 1.25rem 0 0;
    color: var(--auth-muted);
    font-size: .88rem;
}
.wsr-auth__foot a {
    color: var(--auth-yellow);
    font-weight: 600;
    text-decoration: none;
}
.wsr-auth__foot a:hover { text-decoration: underline; }

/* Inline error/info banners */
.wsr-auth__alert {
    border-radius: var(--auth-field-radius);
    padding: .75rem .9rem;
    margin-bottom: 1.1rem;
    font-size: .88rem;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    line-height: 1.45;
}
.wsr-auth__alert--error {
    background: rgba(248, 81, 73, .08);
    border: 1px solid rgba(248, 81, 73, .3);
    color: #fca5a5;
}
.wsr-auth__alert--success {
    background: rgba(63, 185, 80, .08);
    border: 1px solid rgba(63, 185, 80, .3);
    color: #86efac;
}
.wsr-auth__alert ul { margin: .25rem 0 0 1.1rem; padding: 0; }

/* ----------------------------------- RESPONSIVE ----------------------------------- */
@media (max-width: 991.98px) {
    .wsr-auth { grid-template-columns: 1fr; }
    .wsr-auth__hero {
        padding: 1.75rem 1.5rem;
        min-height: auto;
    }
    .wsr-auth__hero-inner { gap: 1.25rem; }
    .wsr-auth__tagline { font-size: 1.65rem; }
    .wsr-auth__lede { font-size: .95rem; margin-top: .5rem; }
    .wsr-auth__trust { display: none; } /* compact on mobile */
    .wsr-auth__hero-foot { display: none; }
    .wsr-auth__card-wrap { padding: 1.5rem 1rem 2.5rem; }
}
@media (max-width: 575.98px) {
    .wsr-auth__card { padding: 1.5rem 1.25rem; }
    .wsr-auth__title { font-size: 1.4rem; }
}

/* RTL safety */
[dir="rtl"] .wsr-auth__pw-toggle { right: auto; left: .55rem; }
[dir="rtl"] .wsr-auth__label     { left: auto; right: .95rem; }
[dir="rtl"] .wsr-auth__select    { background-position: 18px 22px, 13px 22px; padding-right: .9rem; padding-left: 2rem; }

/* Reduced-motion users: hold still */
@media (prefers-reduced-motion: reduce) {
    .wsr-auth__orb,
    .wsr-auth__card,
    .wsr-auth__field { animation: none !important; opacity: 1 !important; transform: none !important; }
}
