/* ==========================================================================
   Living Scripture App - Auth pages (login, register, forgot / reset password)
   Loaded by views/layouts/main_auth.php together with landing.css, whose brand
   tokens (--lsa-*), buttons, blobs, theme toggle and keyframes are reused.
   Mobile-first: compact gradient header + form, split screen from lg up.
   ========================================================================== */

/* ---------- Base ---------- */
body.lsa-auth-body {
    font-family: var(--lsa-font-body);
    background-color: var(--lsa-body-bg);
    color: var(--lsa-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.lsa-auth-body h1,
.lsa-auth-body h2,
.lsa-auth-body h3,
.lsa-auth-body legend {
    font-family: var(--lsa-font-heading);
    color: var(--lsa-heading);
    letter-spacing: -0.01em;
}

.lsa-auth-body :focus-visible {
    outline: 3px solid rgba(var(--lsa-accent-rgb), .55);
    outline-offset: 2px;
}

.lsa-auth {
    --bs-gutter-x: 0;
}

/* ---------- Brand panel ---------- */
.lsa-auth-brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background: var(--lsa-gradient);
}

.lsa-auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .14) 0%, transparent 55%);
}

/* Scoped under .lsa-auth-brand so they win over the shared .lsa-blob rule in landing.css. */
.lsa-auth-brand .lsa-auth-blob-1 {
    width: 260px;
    height: 260px;
    top: -90px;
    left: -70px;
    background: #b46cff;
}

.lsa-auth-brand .lsa-auth-blob-2 {
    width: 220px;
    height: 220px;
    right: -80px;
    bottom: -90px;
    background: var(--lsa-gold);
    opacity: .3;
    animation-delay: -6s;
}

.lsa-auth-brand .lsa-auth-blob-3 {
    display: none;
    width: 200px;
    height: 200px;
    top: 45%;
    left: 40%;
    background: #ff7ad9;
    opacity: .25;
    animation-delay: -11s;
}

.lsa-auth-brand-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1rem 2.5rem;
}

.lsa-auth-brand-body > * {
    animation: lsa-auth-in .7s cubic-bezier(.2, .7, .2, 1) both;
}

.lsa-auth-brand-body > *:nth-child(2) { animation-delay: .08s; }
.lsa-auth-brand-body > *:nth-child(3) { animation-delay: .16s; }
.lsa-auth-brand-body > *:nth-child(4) { animation-delay: .24s; }

.lsa-auth-brand-title {
    margin: 0;
    font-family: var(--lsa-font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.25;
    color: #fff;
}

.lsa-auth-brand-subtitle {
    margin: .75rem 0 0;
    max-width: 460px;
    font-size: 1.02rem;
    color: rgba(240, 230, 255, .85);
}

.lsa-auth-illus-wrap {
    margin-bottom: 1.75rem;
}

.lsa-auth-brand .lsa-auth-illus {
    max-width: 420px;
}

.lsa-auth-highlights {
    gap: 1rem;
    margin: 1.75rem 0 0;
    padding: 0;
}

.lsa-auth-highlights li {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    font-size: .92rem;
    color: rgba(240, 230, 255, .82);
}

.lsa-auth-highlights strong {
    display: block;
    color: #fff;
    font-weight: 600;
}

.lsa-auth-highlight-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: .85rem;
    font-size: 1.25rem;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.lsa-auth-quote {
    position: relative;
    margin: 0;
    padding: 1.25rem 1.35rem 1.1rem;
    border-radius: var(--lsa-radius);
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: lsa-auth-in .8s .3s cubic-bezier(.2, .7, .2, 1) both;
}

.lsa-auth-quote blockquote {
    font-size: .95rem;
    line-height: 1.55;
    color: #fff;
}

.lsa-auth-quote figcaption {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--lsa-gold);
}

.lsa-auth-quote-mark {
    position: absolute;
    top: -.85rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--lsa-gold);
}

/* ---------- Top bar (inside the brand panel) ---------- */
.lsa-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-width: 0;
}

.lsa-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.lsa-auth-logo:hover {
    color: #fff;
}

.lsa-auth-logo-name {
    font-family: var(--lsa-font-heading);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lsa-auth-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 42px;
    padding: 0 .75rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background-color .2s ease;
}

.lsa-auth-back:hover,
.lsa-auth-back:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

/* ---------- Form column ---------- */
.lsa-auth-form-col {
    position: relative;
    z-index: 3;
    margin-top: -1.5rem;
    border-radius: 1.5rem 1.5rem 0 0;
    background: var(--lsa-body-bg);
}

.lsa-auth-card {
    max-width: 440px;
    animation: lsa-auth-in .6s cubic-bezier(.2, .7, .2, 1) both;
}

.lsa-auth-card-wide {
    max-width: 600px;
}

.lsa-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .75rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lsa-accent);
    background: var(--lsa-gradient-soft);
}

.lsa-auth-body .lsa-auth-title {
    margin-bottom: .4rem;
    font-weight: 800;
    font-size: clamp(1.6rem, 6vw, 2.15rem);
    line-height: 1.15;
}

.lsa-auth-subtitle {
    margin-bottom: 1.5rem;
    color: var(--lsa-text-muted);
}

.lsa-auth-form-col a:not(.btn) {
    color: var(--lsa-accent);
    font-weight: 600;
    text-decoration: none;
}

.lsa-auth-form-col a:not(.btn):hover {
    text-decoration: underline;
}

.lsa-auth-switch {
    margin: 1.75rem 0 0;
    text-align: center;
    color: var(--lsa-text-muted);
}

.lsa-auth-footer {
    font-size: .8rem;
    color: var(--lsa-text-muted);
}

.lsa-auth-footer a:not(.btn) {
    font-weight: 500;
    color: var(--lsa-text-muted);
}

/* ---------- Alerts ---------- */
.lsa-auth-alert {
    border-radius: 1rem;
    font-size: .92rem;
}

.lsa-auth-alert-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

/* ---------- Fields ---------- */
.lsa-auth-label {
    margin-bottom: .4rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--lsa-heading);
}

.lsa-auth-input.form-control,
.lsa-auth-input.form-select {
    min-height: 50px;
    padding: .7rem 1rem;
    border-radius: .9rem;
    border: 1px solid var(--lsa-border);
    color: var(--lsa-text);
    background-color: var(--lsa-surface-alt);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.lsa-auth-input.form-control::placeholder {
    color: var(--lsa-text-muted);
    opacity: .7;
}

.lsa-auth-input.form-control:focus,
.lsa-auth-input.form-select:focus {
    border-color: var(--lsa-accent);
    background-color: var(--lsa-surface);
    box-shadow: 0 0 0 .25rem rgba(var(--lsa-accent-rgb), .18);
}

.lsa-auth-input.form-select:disabled {
    opacity: .65;
}

.lsa-auth-input.is-invalid {
    border-color: var(--bs-form-invalid-border-color, #dc3545);
}

.lsa-auth-input.is-invalid:focus {
    box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .18);
}

/* Yii renders the error container next to the input wrapper, so show it whenever it has text. */
.lsa-auth-form .invalid-feedback:not(:empty) {
    display: block;
}

.lsa-input-icon {
    position: relative;
}

.lsa-input-icon > .ph {
    position: absolute;
    top: 25px;
    left: 1rem;
    z-index: 4;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--lsa-text-muted);
    pointer-events: none;
    transition: color .2s ease;
}

.lsa-input-icon:focus-within > .ph {
    color: var(--lsa-accent);
}

.lsa-input-icon > .form-control,
.lsa-input-icon > .form-select {
    padding-left: 2.85rem;
}

.lsa-input-icon-end > .form-control,
.lsa-input-icon-end > .form-control.is-invalid {
    padding-right: 3.25rem;
    background-image: none;
}

.lsa-pw-toggle {
    position: absolute;
    top: 25px;
    right: .4rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--lsa-text-muted);
    background: transparent;
    transition: color .2s ease, background-color .2s ease;
}

.lsa-pw-toggle:hover,
.lsa-pw-toggle[aria-pressed="true"] {
    color: var(--lsa-accent);
    background: rgba(var(--lsa-accent-rgb), .1);
}

.lsa-auth-form .form-check-input {
    width: 1.15em;
    height: 1.15em;
    border-color: var(--lsa-border);
}

.lsa-auth-form .form-check-input:checked {
    background-color: var(--lsa-accent);
    border-color: var(--lsa-accent);
}

.lsa-auth-form .form-check-input:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--lsa-accent-rgb), .2);
}

.lsa-auth-form .form-check-label {
    font-size: .92rem;
    color: var(--lsa-text-muted);
}

.lsa-auth-submit {
    min-height: 52px;
}

.lsa-auth-submit[disabled] {
    opacity: .85;
}

/* ---------- Password strength ---------- */
.lsa-strength {
    display: none;
    margin-top: .55rem;
}

.lsa-strength.is-ready {
    display: block;
}

.lsa-strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
}

.lsa-strength-bars span {
    height: 5px;
    border-radius: 999px;
    background: var(--lsa-border);
    transition: background-color .25s ease;
}

.lsa-strength-label {
    display: block;
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--lsa-text-muted);
}

.lsa-strength[data-level="1"] .lsa-strength-bars span:nth-child(-n+1) { background: #e5484d; }
.lsa-strength[data-level="2"] .lsa-strength-bars span:nth-child(-n+2) { background: #f5a524; }
.lsa-strength[data-level="3"] .lsa-strength-bars span:nth-child(-n+3) { background: var(--lsa-accent); }
.lsa-strength[data-level="4"] .lsa-strength-bars span { background: #30a46c; }

/* ---------- Wizard ---------- */
.lsa-auth-form:not(.is-wizard) .lsa-wizard-only {
    display: none !important;
}

.lsa-wizard-progress {
    margin-bottom: 1.75rem;
}

.lsa-wizard-dots {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .85rem;
    padding: 0;
    list-style: none;
}

.lsa-wizard-dot {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    color: var(--lsa-text-muted);
}

.lsa-wizard-dot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    border: 2px solid var(--lsa-border);
    font-weight: 700;
    color: var(--lsa-text-muted);
    background: var(--lsa-surface);
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .3s ease;
}

.lsa-wizard-dot-num .ph {
    display: none;
}

.lsa-wizard-dot.is-active {
    color: var(--lsa-heading);
}

.lsa-wizard-dot.is-active .lsa-wizard-dot-num {
    border-color: var(--lsa-accent);
    color: #fff;
    background: var(--lsa-accent);
    box-shadow: 0 8px 20px -8px rgba(var(--lsa-accent-rgb), .9);
    transform: scale(1.06);
}

.lsa-wizard-dot.is-done .lsa-wizard-dot-num {
    border-color: var(--lsa-accent);
    color: var(--lsa-accent);
    background: rgba(var(--lsa-accent-rgb), .12);
}

.lsa-wizard-dot.is-done .lsa-wizard-dot-n {
    display: none;
}

.lsa-wizard-dot.is-done .lsa-wizard-dot-num .ph {
    display: inline-block;
}

.lsa-wizard-bar {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--lsa-border);
}

.lsa-wizard-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lsa-primary), var(--lsa-accent));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.lsa-wizard-step {
    min-width: 0;
    margin: 0 0 2rem;
    padding: 0;
    border: 0;
}

.lsa-wizard-step-title {
    float: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin-bottom: 1.1rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.lsa-wizard-step-title:focus {
    outline: none;
}

.lsa-wizard-step-title .ph {
    font-size: 1.35rem;
    color: var(--lsa-accent);
}

.lsa-wizard-step-count {
    margin-left: auto;
    font-family: var(--lsa-font-body);
    font-size: .78rem;
    font-weight: 600;
    color: var(--lsa-text-muted);
}

.lsa-wizard-actions {
    margin-top: 1.75rem;
}

.is-wizard .lsa-wizard-step {
    display: none;
    margin-bottom: 0;
}

.is-wizard .lsa-wizard-step.is-active {
    display: block;
    animation: lsa-step-in .45s cubic-bezier(.2, .7, .2, 1) both;
}

.is-wizard .lsa-wizard-step.is-active.is-back {
    animation-name: lsa-step-in-back;
}

.lsa-wizard-summary {
    margin: 1.25rem 0 0;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px dashed rgba(var(--lsa-accent-rgb), .35);
    background: var(--lsa-gradient-soft);
}

.lsa-wizard-summary-title {
    margin-bottom: .6rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lsa-accent);
}

.lsa-wizard-summary dl {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: .35rem 1rem;
    margin: 0;
    font-size: .9rem;
}

.lsa-wizard-summary dt {
    font-weight: 500;
    color: var(--lsa-text-muted);
}

.lsa-wizard-summary dd {
    margin: 0;
    font-weight: 600;
    color: var(--lsa-heading);
    overflow-wrap: anywhere;
}

/* ---------- Large screens: split layout ---------- */
@media (min-width: 992px) {
    .lsa-auth-brand {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        min-height: 640px;
    }

    .lsa-auth-brand-inner {
        height: 100%;
        gap: 1.5rem;
        padding: 1.75rem 2.5rem 2.25rem;
    }

    .lsa-auth-brand-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }

    .lsa-auth-brand-title {
        font-size: clamp(1.9rem, 2.6vw, 2.6rem);
        line-height: 1.12;
        font-weight: 800;
    }

    .lsa-auth-brand .lsa-auth-blob-1 {
        width: 380px;
        height: 380px;
    }

    .lsa-auth-brand .lsa-auth-blob-3 {
        display: block;
    }

    .lsa-auth-form-col {
        margin-top: 0;
        border-radius: 0;
    }
}

@media (min-width: 992px) and (max-height: 760px) {
    .lsa-auth-illus-wrap {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .lsa-auth-brand-inner {
        padding: 2rem 3.5rem 2.5rem;
    }
}

/* ---------- Dark theme ---------- */
[data-bs-theme=dark] .lsa-auth-brand {
    background: linear-gradient(135deg, #12052a 0%, #2d0a5a 50%, #5a1fa3 100%);
}

[data-bs-theme=dark] .lsa-auth-input.form-control,
[data-bs-theme=dark] .lsa-auth-input.form-select {
    background-color: var(--lsa-surface);
}

[data-bs-theme=dark] .lsa-auth-input.form-control:focus,
[data-bs-theme=dark] .lsa-auth-input.form-select:focus {
    background-color: #1c1430;
}

[data-bs-theme=dark] .lsa-wizard-dot-num {
    background: var(--lsa-surface-alt);
}

[data-bs-theme=dark] .lsa-auth-eyebrow,
[data-bs-theme=dark] .lsa-wizard-summary-title,
[data-bs-theme=dark] .lsa-auth-form-col a:not(.btn) {
    color: #c79bff;
}

/* ---------- Motion ---------- */
@keyframes lsa-auth-in {
    from {
        opacity: 0;
        transform: translate3d(0, 18px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes lsa-step-in {
    from {
        opacity: 0;
        transform: translate3d(28px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes lsa-step-in-back {
    from {
        opacity: 0;
        transform: translate3d(-28px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lsa-auth-body *,
    .lsa-auth-body *::before,
    .lsa-auth-body *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }

    .lsa-auth-body .btn.lsa-shine::after {
        display: none;
    }
}
