/* =====================================================================
   SM BizSoft — Premium Authentication (Login / Register Wizard)
   Depends on smbiz.css design tokens (:root variables)
   ===================================================================== */

.auth-body {
    margin: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--body, #475569);
    background: #F6F7FB;
    -webkit-font-smoothing: antialiased;
}

.auth-wrap {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* ---------- Left brand panel ---------- */
.auth-aside {
    position: relative;
    background: linear-gradient(150deg, #6D28D9 0%, #4F46E5 52%, #2563EB 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auth-aside::before {
    content: "";
    position: absolute; width: 420px; height: 420px; border-radius: 50%;
    background: rgba(255,255,255,.10); top: -140px; right: -120px;
}
.auth-aside::after {
    content: "";
    position: absolute; width: 320px; height: 320px; border-radius: 50%;
    background: rgba(255,255,255,.07); bottom: -120px; left: -90px;
}
.auth-aside > * { position: relative; z-index: 2; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: auto; }
.auth-brand img { height: 42px; filter: brightness(0) invert(1); }
.auth-aside .aside-body { margin: 40px 0; }
.auth-aside h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 14px; }
.auth-aside p.lead { color: rgba(255,255,255,.88); font-size: 16px; margin: 0 0 28px; max-width: 440px; }

.aside-benefits { list-style: none; padding: 0; margin: 0; }
.aside-benefits li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.aside-benefits li .bi {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
    background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 16px; color: #fff;
}
.aside-benefits li h6 { color: #fff; font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.aside-benefits li span { color: rgba(255,255,255,.8); font-size: 13.5px; }

.aside-quote {
    margin-top: 36px; padding: 22px 24px; border-radius: 18px;
    background: rgba(255,255,255,.12); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.18);
}
.aside-quote p { color: #fff; font-size: 14.5px; font-style: italic; margin: 0 0 12px; }
.aside-quote .who { display: flex; align-items: center; gap: 10px; }
.aside-quote .who .av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 700; }
.aside-quote .who b { display: block; font-size: 13.5px; }
.aside-quote .who small { color: rgba(255,255,255,.75); }

.auth-aside .aside-foot { margin-top: auto; display: flex; gap: 22px; color: rgba(255,255,255,.8); font-size: 13px; }
.auth-aside .aside-foot span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Right form panel ---------- */
.auth-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 24px; position: relative;
}
.auth-topbar {
    position: absolute; top: 22px; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center; padding: 0 32px;
}
.auth-topbar .home-link { color: var(--muted, #64748B); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.auth-topbar .home-link:hover { color: var(--brand, #6D28D9); }
.auth-topbar .switch { font-size: 14px; color: var(--muted, #64748B); }
.auth-topbar .switch a { color: var(--brand, #6D28D9); font-weight: 600; }

.auth-card { width: 100%; max-width: 440px; }
.auth-card .mobile-logo { display: none; text-align: center; margin-bottom: 22px; }
.auth-card .mobile-logo img { height: 44px; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 28px; font-weight: 800; color: var(--ink, #0F172A); letter-spacing: -.02em; margin: 0 0 6px; }
.auth-head p { color: var(--muted, #64748B); font-size: 15px; margin: 0; }

/* ---------- Fields ---------- */
.auth-field { margin-bottom: 18px; }
.auth-field > label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink, #0F172A); margin-bottom: 7px; }
.auth-control { position: relative; }
.auth-control > .fa, .auth-control > .ic {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #94A3B8; font-size: 15px; pointer-events: none;
}
.auth-control input,
.auth-control select {
    width: 100%; height: 52px; border: 1.5px solid #E2E8F0; border-radius: 13px;
    padding: 0 16px 0 44px; font-size: 15px; color: var(--ink, #0F172A); background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease; outline: none;
    appearance: none; -webkit-appearance: none;
}
.auth-control textarea { padding-left: 16px; }
.auth-control input::placeholder { color: #AEB7C5; }
.auth-control input:focus,
.auth-control select:focus { border-color: var(--brand, #6D28D9); box-shadow: 0 0 0 4px rgba(109,40,217,.12); }
.auth-control.has-error input,
.auth-control.has-error select { border-color: #EF4444; }
.auth-control select { cursor: pointer; padding-right: 40px; }
.auth-control .selarrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #94A3B8; pointer-events: none; }
.pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #94A3B8; cursor: pointer; background: none; border: none; font-size: 15px; padding: 4px; }
.pw-toggle:hover { color: var(--brand, #6D28D9); }
.field-err { display: block; color: #EF4444; font-size: 12.5px; margin-top: 6px; }
.field-hint { display: block; color: var(--muted, #64748B); font-size: 12.5px; margin-top: 6px; }

/* subdomain preview chip */
.subdomain-preview {
    margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #F4F0FF; border: 1px dashed #C9BCF5; border-radius: 12px; padding: 11px 14px;
    font-size: 13.5px; color: var(--brand-2, #4F46E5);
}
.subdomain-preview i { color: var(--brand, #6D28D9); }
.subdomain-preview b { color: var(--brand, #6D28D9); }

/* ---------- Buttons ---------- */
.auth-btn {
    width: 100%; height: 52px; border: none; border-radius: 13px; cursor: pointer;
    background: linear-gradient(135deg, #6D28D9 0%, #4F46E5 55%, #2563EB 100%);
    color: #fff; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 12px 26px rgba(109,40,217,.30); transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(109,40,217,.40); filter: brightness(1.04); color: #fff; }
.auth-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.auth-btn-ghost {
    height: 52px; border: 1.5px solid #E2E8F0; border-radius: 13px; background: #fff; cursor: pointer;
    color: var(--ink, #0F172A); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 22px; transition: .18s ease;
}
.auth-btn-ghost:hover { border-color: var(--brand, #6D28D9); color: var(--brand, #6D28D9); }
.auth-actions { display: flex; gap: 12px; margin-top: 6px; }
.auth-actions .auth-btn { flex: 1; }

/* row helpers */
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 18px; }
.auth-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--body, #475569); cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand, #6D28D9); flex: 0 0 auto; }
.auth-check a { color: var(--brand, #6D28D9); font-weight: 600; }
.auth-link { color: var(--brand, #6D28D9); font-size: 13.5px; font-weight: 600; }

/* alert */
.auth-alert { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; padding: 13px 15px; font-size: 13.5px; margin-bottom: 18px; }
.auth-alert.error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth-alert.success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }

/* divider + footer */
.auth-foot { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted, #64748B); }
.auth-foot a { color: var(--brand, #6D28D9); font-weight: 600; }
.auth-legal { text-align: center; margin-top: 26px; font-size: 12px; color: #94A3B8; }
.auth-legal a { color: #94A3B8; text-decoration: underline; }

/* ---------- Wizard stepper ---------- */
.wiz-head { margin-bottom: 26px; }
.wiz-progress { height: 6px; border-radius: 999px; background: #E9ECF5; overflow: hidden; margin-bottom: 20px; }
.wiz-progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6D28D9, #2563EB); transition: width .35s ease; }
.wiz-steps { display: flex; justify-content: space-between; gap: 6px; }
.wiz-steps .ws { flex: 1; text-align: center; position: relative; }
.wiz-steps .ws .dot {
    width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center;
    background: #fff; border: 2px solid #E2E8F0; color: #94A3B8; font-weight: 700; font-size: 14px;
    transition: .25s ease; position: relative; z-index: 2;
}
.wiz-steps .ws .lbl { font-size: 12px; color: #94A3B8; font-weight: 500; }
.wiz-steps .ws.active .dot { border-color: var(--brand, #6D28D9); color: var(--brand, #6D28D9); box-shadow: 0 0 0 4px rgba(109,40,217,.12); }
.wiz-steps .ws.done .dot { background: linear-gradient(135deg, #6D28D9, #2563EB); border-color: transparent; color: #fff; }
.wiz-steps .ws.active .lbl, .wiz-steps .ws.done .lbl { color: var(--ink, #0F172A); }
.wiz-steps .ws::before {
    content: ""; position: absolute; top: 19px; left: -50%; width: 100%; height: 2px; background: #E2E8F0; z-index: 1;
}
.wiz-steps .ws:first-child::before { display: none; }
.wiz-steps .ws.done::before, .wiz-steps .ws.active::before { background: linear-gradient(90deg, #6D28D9, #2563EB); }
.wiz-pane-title { font-size: 19px; font-weight: 700; color: var(--ink, #0F172A); margin: 0 0 2px; }
.wiz-pane-sub { font-size: 13.5px; color: var(--muted, #64748B); margin: 0 0 20px; }

/* loader overlay */
.auth-loader { position: fixed; inset: 0; background: rgba(246,247,251,.92); backdrop-filter: blur(4px); z-index: 9999; display: grid; place-items: center; text-align: center; padding: 30px; }
.auth-loader img { width: 140px; margin-bottom: 22px; }
.auth-loader .msg { color: var(--ink, #0F172A); font-size: 17px; font-weight: 500; max-width: 360px; }
.auth-loader .spinner2 { width: 46px; height: 46px; margin: 22px auto 0; border: 4px solid #E2E8F0; border-top-color: var(--brand, #6D28D9); border-radius: 50%; animation: spin2 .8s linear infinite; }
@keyframes spin2 { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-card .mobile-logo { display: block; }
    .auth-topbar { position: static; padding: 0; margin-bottom: 8px; width: 100%; max-width: 440px; }
    .auth-main { justify-content: flex-start; padding-top: 32px; }
}
@media (max-width: 480px) {
    .auth-main { padding: 24px 18px; }
    .auth-head h1 { font-size: 24px; }
    .wiz-steps .ws .lbl { display: none; }
}
