/* ==========================================================================
   FLUXA — Auth Pages (Login, Register, Password Reset, Verification)
   Loaded once via auth.layout.blade.php. Page-specific sections are marked
   below so each view's rules stay easy to find.
   ========================================================================== */

[v-cloak] { display: none; }

/* ============ Variables ============ */
:root {
    --auth-bg: #f6f7fb;
    --auth-panel: #ffffff;
    --auth-ink: #101828;
    --auth-muted: #667085;
    --auth-line: #e4e7ec;
    --auth-accent: #4f46e5;
    --auth-accent-rgb: 79, 70, 229;
    --auth-accent-hover: #4338ca;
    --auth-accent-active: #3730a3;
    --auth-accent-border: #c7d2fe;
    --auth-danger: var(--bs-danger);
    --auth-danger-line: #fda29b;
    --auth-success: #067647;
    --auth-warning: #b54708;
    --auth-radius: .65rem;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-ink);
    -webkit-font-smoothing: antialiased;
}

/* ============ Shell Layout ============ */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* ============ Brand Panel (left) ============ */
.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 56px 56px 48px;
    color: #fff;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 45%),
        linear-gradient(155deg, var(--auth-accent-active) 0%, var(--auth-accent-hover) 38%, var(--auth-accent) 100%);
}

@media (min-width: 992px) {
    .auth-brand { display: flex; flex-direction: column; }
}

/* Decorative layer — dot grid + soft blobs + orbit rings, all non-interactive */
.auth-brand-decor {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-brand-grid {
    position: absolute;
    inset: -1px;
    background-image: radial-gradient(rgba(255, 255, 255, .28) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(85% 75% at 30% 22%, #000 0%, transparent 72%);
    mask-image: radial-gradient(85% 75% at 30% 22%, #000 0%, transparent 72%);
    opacity: .5;
}

.auth-brand-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
}

.auth-brand-blob-1 {
    right: -160px;
    bottom: -180px;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle at center, rgba(56, 189, 248, .38), rgba(56, 189, 248, 0) 70%);
}

.auth-brand-blob-2 {
    left: -120px;
    top: -140px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%);
}

.auth-brand-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
}

.auth-brand-ring-1 { right: 6%; top: 14%; width: 220px; height: 220px; }
.auth-brand-ring-2 { right: 16%; top: 24%; width: 120px; height: 120px; border-color: rgba(255, 255, 255, .22); }

.auth-brand-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
}

.auth-brand-dot-1 { right: 12%; top: 12%; }
.auth-brand-dot-2 { right: 30%; top: 40%; width: 5px; height: 5px; background: rgba(56, 189, 248, .8); }
.auth-brand-dot-3 { right: 9%; top: 46%; width: 4px; height: 4px; }

.auth-brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -.02em;
}

.auth-brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 4px 14px rgba(17, 12, 60, .22);
    overflow: hidden;
}

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

.auth-brand-eyebrow {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
}

.auth-brand-headline {
    margin-top: 18px;
    font-size: 2.05rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
    max-width: 22ch;
}

.auth-brand-sub {
    margin-top: 14px;
    color: rgba(255, 255, 255, .82);
    font-size: 1.02rem;
    max-width: 42ch;
}

.auth-brand-list {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: .94rem;
    color: rgba(255, 255, 255, .92);
}

.auth-brand-list-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .14);
    font-size: .88rem;
}

.auth-brand-foot {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .8);
    font-size: .85rem;
}

/* ============ Form Panel (right) ============ */
.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-panel { width: min(100%, 452px); }

.auth-mobile-brand { text-align: center; margin-bottom: 28px; }
@media (min-width: 992px) { .auth-mobile-brand { display: none; } }

.auth-logo { max-height: 44px; max-width: 190px; }

.auth-brand-fallback {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
}

/* ============ Typography ============ */
.auth-title { font-weight: 700; letter-spacing: -.02em; }
.auth-subtitle { color: var(--auth-muted); }

/* ============ Form Controls ============ */
.form-label { font-weight: 600; font-size: .875rem; color: #344054; margin-bottom: .4rem; }

.form-control, .form-select {
    border-color: var(--auth-line);
    border-radius: var(--auth-radius);
    padding: .68rem .95rem;
    background-color: #f9fafb;
    font-size: .95rem;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.form-control:hover, .form-select:hover { border-color: #ccd0da; }
.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--auth-accent);
    box-shadow: none !important;
    outline: none;
}
.form-control::placeholder { color: #98a2b3; }

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

/* ============ Buttons ============ */
.btn-auth {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--auth-accent);
    --bs-btn-border-color: var(--auth-accent);
    --bs-btn-hover-bg: var(--auth-accent-hover);
    --bs-btn-hover-border-color: var(--auth-accent-hover);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--auth-accent-active);
    --bs-btn-active-border-color: var(--auth-accent-active);
    --bs-btn-disabled-bg: var(--auth-accent);
    --bs-btn-disabled-border-color: var(--auth-accent);
    font-weight: 700;
    padding: .7rem 1rem;
    border-radius: var(--auth-radius);
    box-shadow: 0 8px 20px rgba(var(--auth-accent-rgb), .22);
}

/* ============ Links ============ */
.auth-link { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ============ Alerts & Field Validation ============ */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-left: 3px solid currentColor;
    border-radius: .625rem;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .8rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.auth-alert .bi { font-size: 1rem; line-height: 1.4; flex-shrink: 0; margin-top: .1rem; }
.auth-alert span { line-height: 1.4; }

.auth-alert.alert-danger  { color: var(--auth-danger); }
.auth-alert.alert-success { color: var(--auth-success); }
.auth-alert.alert-warning { color: var(--auth-warning); }

/* Multiple messages in one alert render as a plain list, one per line. */
.auth-alert-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .25rem; }
.auth-alert-list li { line-height: 1.4; }

.invalid-feedback { font-weight: 500; }
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--auth-danger-line); }
.form-control.is-invalid:focus,
.form-select.is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }

/* ============ Login ============ */
/* Login uses only the shared components above — no page-specific rules. */

/* ============ Password Reset / Verification ============ */

/* ============ Register — Stepper ============ */
.reg-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; }
.reg-step { display: flex; align-items: center; gap: 8px; }
.reg-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem;
    background: #eef0f5; color: #98a2b3; border: 1px solid var(--auth-line); transition: all .2s ease;
}
.reg-step-label { font-weight: 600; font-size: .8rem; color: #98a2b3; white-space: nowrap; }
.reg-step.is-active .reg-step-dot { background: var(--auth-accent); color: #fff; border-color: var(--auth-accent); }
.reg-step.is-active .reg-step-label { color: var(--auth-ink); }
.reg-step.is-done .reg-step-dot { background: #ecfdf3; color: #12b76a; border-color: #a6f4c5; }
.reg-step-line { flex: 1; height: 2px; background: var(--auth-line); border-radius: 2px; }
@media (max-width: 400px) { .reg-step-label { display: none; } }

/* ============ Register — Form Fields ============ */
.field { margin-bottom: 1rem; }

/* ============ Register — OTP Input ============ */
.otp-code { position: relative; }

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: .5rem;
}

.otp-box {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    max-width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: #f9fafb;
    color: var(--auth-ink);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.otp-box.is-filled { background: #fff; }

.otp-input {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: text;
}

.otp-input:focus { box-shadow: none; }
.otp-input:disabled { cursor: wait; }

.otp-code:focus-within .otp-box {
    background: #fff;
    border-color: var(--auth-accent-border);
}

.otp-code:focus-within .otp-box.is-active {
    border-color: var(--auth-accent);
    box-shadow: none !important;
}

.otp-code.is-invalid .otp-box { border-color: var(--auth-danger-line); }
.otp-code.is-invalid:focus-within .otp-box.is-active {
    border-color: var(--auth-danger-line);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .12);
}

@media (max-width: 400px) {
    .otp-inputs { gap: .35rem; }
    .otp-box { height: 2.9rem; font-size: 1.2rem; }
}

/* ============ Register — Password Strength Meter ============ */
.pw-meter { display: flex; gap: 5px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 5px; border-radius: 3px; background: var(--auth-line); transition: background .2s ease; }
.pw-hint { font-size: .78rem; color: var(--auth-muted); margin-top: 6px; }
.pw-s1 span:nth-child(1) { background: #f04438; }
.pw-s2 span:nth-child(-n+2) { background: #f79009; }
.pw-s3 span:nth-child(-n+3) { background: #eab308; }
.pw-s4 span { background: #12b76a; }

/* ============ Register — Password Visibility Toggle ============ */
.input-eye { position: relative; }
.input-eye .toggle-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--auth-muted); cursor: pointer; padding: 0; }
.input-eye .form-control { padding-right: 40px; }


/* ============ Register — Submit Spinner ============ */
.btn-spinner { display: none; width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: reg-spin .6s linear infinite; }
.is-loading .btn-spinner { display: inline-block; }
@keyframes reg-spin { to { transform: rotate(360deg); } }
