/* ═══════════════════════════════════════════════════════════
   AUTH.CSS — Login & Register redesign  |  Chifa AI
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Root tokens ── */
#ar {
    --bg:    #eef2ff;
    --card:  #ffffff;
    --text:  #1e293b;
    --muted: #64748b;
    --faint: #94a3b8;
    --bdr:   #e2e8f0;
    --in:    #f8fafc;
    --blue:  #2563eb;
    --ind:   #4f46e5;
    --pale:  #eff6ff;
    --red:   #ef4444;
    --rp:    #fef2f2;
    --shd:   0 8px 32px rgba(37,99,235,.14);
    min-height: 100vh;
    background: var(--bg);
    transition: background .3s;
}
#ar.dark {
    --bg:    #0f172a;
    --card:  #1e293b;
    --text:  #f1f5f9;
    --muted: #94a3b8;
    --faint: #475569;
    --bdr:   #334155;
    --in:    #0f172a;
    --pale:  rgba(37,99,235,.12);
    --rp:    rgba(239,68,68,.1);
    --shd:   0 8px 40px rgba(0,0,0,.5);
}

/* ── Layout ── */
.al { display: flex; min-height: 100vh; }

/* ═══ LEFT PANEL ═══════════════════════════════════════════ */
.alp {
    flex: 0 0 44%;
    background: linear-gradient(150deg, #1e3a8a 0%, #2d2088 55%, #1e1b4b 100%);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 56px 44px;
}
@media (max-width: 767px) { .alp { display: none; } }

.alp-inner { position: relative; z-index: 2; color: #fff; max-width: 320px; }

.alp-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 38px;
}
.alp-brand .ahic {
    font-size: 38px;
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: abh 2s ease-in-out infinite;
}
@keyframes abh {
    0%, 42%, 100% { transform: scale(1); }
    14%           { transform: scale(1.28); }
    28%           { transform: scale(1.06); }
    36%           { transform: scale(1.2);  }
}
.alp-brand span { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }

.alp-inner h2 { font-size: 1.65rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.alp-inner > p { font-size: .87rem; color: rgba(255,255,255,.62); line-height: 1.65; margin-bottom: 36px; }

.alp-feats { display: flex; flex-direction: column; gap: 9px; }
.alp-feat {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 10px 14px;
    font-size: .82rem; color: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    transition: background .2s;
}
.alp-feat:hover { background: rgba(255,255,255,.13); }
.alp-feat i { font-size: 16px; color: #93c5fd; flex-shrink: 0; }

/* Decorative bubbles */
.abbl { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); }
.ab1  { width: 320px; height: 320px; top: -100px; right: -100px; }
.ab2  { width: 200px; height: 200px; bottom: -50px; left: -80px; }
.ab3  { width: 110px; height: 110px; top: 45%; right: 18%; }
.ab4  { width: 55px; height: 55px; top: 22%; left: 12%; animation: afloat 7s ease-in-out infinite; }
@keyframes afloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ═══ RIGHT PANEL ═══════════════════════════════════════════ */
.arp {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow-y: auto;
}

/* Dark/Light toggle */
.athm {
    position: absolute; top: 16px; right: 16px;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid var(--bdr);
    background: var(--card); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 17px;
    transition: all .2s; z-index: 10;
}
.athm:hover { background: var(--pale); color: var(--blue); }

/* ── Auth Card ── */
.acard {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shd);
    padding: 40px 36px;
    width: 100%; max-width: 420px;
    animation: acin .4s cubic-bezier(.4,0,.2,1) both;
}
@keyframes acin {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile brand (hidden on desktop where left panel shows) */
.amb {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 20px;
}
.amb .ahic {
    font-size: 28px;
    background: linear-gradient(135deg, #38bdf8, #2563eb, #4f46e5);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: abh 2s ease-in-out infinite;
}
.amb span { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }

.ath  { font-size: 1.35rem; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -.02em; }
.asub { font-size: .84rem; color: var(--muted); margin-bottom: 26px; }

/* ── Alerts ── */
.aalt {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: 10px; padding: 12px 14px;
    font-size: .81rem; margin-bottom: 18px;
}
.aalt.aw { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.aalt.ad { background: var(--rp); border: 1px solid rgba(239,68,68,.2); color: #991b1b; }
#ar.dark .aalt.aw { background: rgba(234,179,8,.07); border-color: rgba(234,179,8,.2); color: #fde68a; }
#ar.dark .aalt.ad { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); color: #fca5a5; }
.aalt i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.aalt a { color: inherit; font-size: .75rem; text-decoration: underline; }
.acd { display: inline-block; font-weight: 700; color: var(--blue); }
#ar.dark .acd { color: #60a5fa; }

/* ── Form fields ── */
.fg { margin-bottom: 16px; }

.flbl {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .79rem; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.flbl a { font-weight: 500; color: var(--blue); text-decoration: none; font-size: .76rem; }
.flbl a:hover { text-decoration: underline; }

.fin {
    display: flex; align-items: center;
    background: var(--in);
    border: 1.5px solid var(--bdr);
    border-radius: 10px; overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.fin:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fg.err .fin { border-color: var(--red); }
.fg.err .fin:focus-within { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.fin-ic { flex-shrink: 0; width: 40px; text-align: center; font-size: 16px; color: var(--faint); }

.fin input,
.fin select {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: .87rem; color: var(--text);
    padding: 11px 8px 11px 0;
    -webkit-appearance: none; appearance: none;
}
.fin input::placeholder { color: var(--faint); }
#ar.dark .fin input { color-scheme: dark; }

.fin-btn {
    width: 40px; flex-shrink: 0; border: none; background: transparent;
    color: var(--faint); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; padding: 0; transition: color .15s; height: 42px;
}
.fin-btn:hover { color: var(--blue); }

/* Select wrapper arrow */
.sel-wrap { position: relative; display: flex; align-items: center; }
.sel-wrap::after {
    content: '\ea4e'; font-family: remixicon;
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--faint); font-size: 16px; pointer-events: none;
}

.ferr {
    display: flex; align-items: center; gap: 4px;
    margin-top: 5px; font-size: .74rem; color: var(--red);
}

/* Hint text under field */
.fhint { font-size: .72rem; color: var(--faint); margin-top: 4px; }

/* ── Password strength ── */
.pws { margin-top: 6px; }
.pws-bar { height: 3px; background: var(--bdr); border-radius: 3px; overflow: hidden; }
.pws-fill { height: 100%; width: 0%; border-radius: 3px; transition: width .4s, background .4s; background: var(--red); }
.pws-txt { font-size: .71rem; color: var(--faint); margin-top: 4px; }
.pws-txt span { font-weight: 600; }

/* ── Checkbox ── */
.ackb {
    display: flex; align-items: center; gap: 8px;
    font-size: .81rem; color: var(--muted);
    margin-bottom: 18px; cursor: pointer; user-select: none;
}
.ackb input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
.ackb a { color: var(--blue); text-decoration: none; }
.ackb a:hover { text-decoration: underline; }

/* ── Submit button ── */
.abtn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--ind) 100%);
    color: #fff; border: none; border-radius: 10px;
    font-size: .9rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    margin-bottom: 10px;
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.abtn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.38); }
.abtn:active { transform: scale(.98); }
.abtn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Spinner in button */
.abtn-sp {
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff; border-radius: 50%;
    display: none; animation: aspin .7s linear infinite; flex-shrink: 0;
}
@keyframes aspin { to { transform: rotate(360deg); } }

/* ── Install PWA button ── */
.ainstall {
    width: 100%; padding: 11px;
    background: transparent; border: 1.5px solid var(--blue);
    border-radius: 10px; color: var(--blue);
    font-size: .84rem; font-weight: 600; cursor: pointer;
    align-items: center; justify-content: center; gap: 7px;
    margin-bottom: 10px; transition: background .15s;
    display: none;
}
.ainstall.show { display: flex; }
.ainstall:hover { background: var(--pale); }

/* ── Download server button ── */
.adl {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px; border-radius: 10px;
    border: 1.5px solid var(--bdr); color: var(--muted);
    text-decoration: none; font-size: .84rem; font-weight: 500;
    margin-bottom: 10px; transition: all .15s;
}
.adl:hover { background: var(--in); color: var(--blue); border-color: var(--blue); }

/* ── Switch link ── */
.asw {
    text-align: center; font-size: .81rem; color: var(--muted);
    margin-top: 18px; padding-top: 18px;
    border-top: 1px solid var(--bdr);
}
.asw a { color: var(--blue); font-weight: 600; text-decoration: none; margin-left: 3px; }
.asw a:hover { text-decoration: underline; }

/* ── Footer ── */
.aft { text-align: center; font-size: .7rem; color: var(--faint); margin-top: 14px; }

/* ── Responsive ── */
@media (max-width: 480px) { .acard { padding: 28px 18px; } }
