/*
 * login.css — ELITE v6
 * Premium split-panel | Floating glass cards | Demo credentials box
 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --white:   #ffffff;
  --border:  #e2e8f0;
  --p:       #2563eb;
  --pd:      #1d4ed8;
  --plight:  #dbeafe;
  --pglow:   rgba(37, 99, 235, .12);
  --a:       #0d9488;
  --alight:  #ccfbf1;
  --s900:    #0f172a;
  --s700:    #334155;
  --s500:    #64748b;
  --s400:    #94a3b8;
  --s300:    #cbd5e1;
  --s100:    #f1f5f9;
  --s50:     #f8fafc;
  --green:   #16a34a;
  --glight:  #dcfce7;
  --gborder: #bbf7d0;
  --rc:      28px;
  --ri:      13px;
  --shadow:  0 24px 64px rgba(15,23,42,.1), 0 4px 16px rgba(15,23,42,.05);
  --sbtn:    0 8px 24px rgba(37,99,235,.28);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: #edf1f7;
  color: var(--s900);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── PAGE GRID ─────────────────────────────────────────────────── */
.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

/* ── LEFT PANEL ─────────────────────────────────────────────────── */
.login-left {
  background: linear-gradient(150deg, #0c2461 0%, #1a56db 55%, #0d8c9e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3.75rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}

/* Decorative circles */
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 420px; height: 420px;
  border-radius: 50%;
  border: 55px solid rgba(255,255,255,.05);
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 40px solid rgba(255,255,255,.04);
  pointer-events: none;
}

/* Brand */
.brand-wrap {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 2.75rem;
  animation: rise .6s ease both;
}
.brand-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: #fff; flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.brand-icon img {
  width: 30px; height: 30px; object-fit: contain; border-radius: 7px;
}
.brand-info-name {
  font-family: 'Sora', sans-serif;
  font-size: 1rem; font-weight: 700; color: #fff;
}
.brand-info-sub {
  font-size: .62rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-top: 2px;
}

/* Headline */
.left-headline { margin-bottom: 2rem; animation: rise .6s .08s ease both; }
.left-headline h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -.03em;
  color: #fff; margin-bottom: .9rem;
}
.left-headline h1 em { font-style: normal; color: #7dd3fc; }
.left-headline p {
  font-size: .88rem; line-height: 1.75;
  color: rgba(255,255,255,.55); max-width: 350px;
}

/* Float cards */
.float-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 2.5rem;
  animation: rise .6s .16s ease both;
}
.float-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 11px;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s;
  cursor: default;
}
.float-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}
.float-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.fc-title { font-size: .77rem; font-weight: 700; color: #fff; }
.fc-sub   { font-size: .61rem; color: rgba(255,255,255,.42); margin-top: 1px; }

/* Feature list (classic alt — not used with float-cards) */
.feature-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 2.25rem; animation: rise .6s .16s ease both;
}
.feature-item {
  display: flex; align-items: center; gap: 12px;
  font-size: .86rem; font-weight: 500; color: rgba(255,255,255,.72);
}
.feature-check {
  width: 20px; height: 20px;
  background: rgba(255,255,255,.12); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .6rem; color: #7dd3fc;
}

/* Stat strip */
.stat-strip {
  display: flex; gap: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,.1);
  animation: rise .6s .24s ease both;
}
.stat-item .num {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem; font-weight: 800; color: #7dd3fc; letter-spacing: -.03em;
}
.stat-item .lbl {
  font-size: .61rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,.38); margin-top: 2px;
}

/* ── RIGHT PANEL ─────────────────────────────────────────────────── */
.login-right {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem; overflow-y: auto;
  background: #edf1f7;
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--white); border-radius: var(--rc);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .7s .1s cubic-bezier(.16,1,.3,1) both;
}
.login-card::before {
  content: ''; display: block; height: 4px;
  background: linear-gradient(90deg, var(--p), var(--a));
}

.card-inner { padding: 2.25rem 2.25rem 1.75rem; }

/* Status badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glight); border: 1px solid var(--gborder);
  border-radius: 100px; padding: 5px 14px;
  font-size: .61rem; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--green); margin-bottom: 1.4rem;
}
.status-dot {
  width: 7px; height: 7px; background: #22c55e;
  border-radius: 50%; animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1}50%{opacity:.3} }

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.65rem; font-weight: 800; color: var(--s900);
  letter-spacing: -.04em; line-height: 1.15; margin-bottom: .3rem;
}
.card-subtitle {
  font-size: .84rem; color: var(--s500);
  margin-bottom: 1.6rem; line-height: 1.5;
}

/* ── DEMO BOX ─────────────────────────────────────────────────────── */
.demo-box {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0; border-radius: 13px;
  padding: 13px 15px; margin-bottom: 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.demo-box-info { flex: 1; min-width: 0; }
.demo-box-label {
  font-size: .6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--green);
  display: flex; align-items: center; gap: 5px; margin-bottom: 6px;
}
.demo-box-row {
  display: flex; align-items: center; gap: 6px;
  font-size: .74rem; color: var(--s700); font-weight: 500;
  margin-bottom: 2px; line-height: 1.4;
}
.demo-box-row span { font-weight: 700; color: var(--s900); }
.demo-box-btn {
  background: #fff; border: 1.5px solid #86efac;
  border-radius: 9px; padding: 8px 13px;
  font-size: .71rem; font-weight: 700; color: var(--green);
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  white-space: nowrap; transition: all .18s;
  font-family: 'Inter', sans-serif; flex-shrink: 0;
}
.demo-box-btn:hover {
  background: var(--green); color: #fff; border-color: var(--green);
  box-shadow: 0 4px 12px rgba(22,163,74,.22);
}

/* ── FORM ─────────────────────────────────────────────────────────── */
.field-group { margin-bottom: 1.1rem; }
.field-label {
  display: block; font-size: .67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--s500); margin-bottom: 8px;
}
.field-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--s50); border: 1.5px solid var(--border);
  border-radius: var(--ri); transition: all .22s ease;
}
.field-wrap:focus-within {
  border-color: var(--p); background: #fff;
  box-shadow: 0 0 0 4px var(--pglow);
}
.field-icon {
  position: absolute; left: 14px; font-size: .95rem;
  color: var(--p); opacity: .6; pointer-events: none;
}
.field-wrap input {
  width: 100%; background: transparent; border: none; outline: none;
  padding: .88rem 1rem .88rem 42px;
  font-size: .91rem; font-weight: 500; color: var(--s900);
  font-family: 'Inter', sans-serif;
}
.field-wrap input::placeholder { color: var(--s300); font-weight: 400; }

.pw-toggle {
  position: absolute; right: 10px; background: none; border: none;
  color: var(--s400); font-size: .95rem; cursor: pointer;
  padding: 7px; border-radius: 7px; transition: all .18s; line-height: 1;
}
.pw-toggle:hover { background: var(--plight); color: var(--p); }

/* ── SUBMIT ───────────────────────────────────────────────────────── */
.btn-login-elite {
  width: 100%; padding: .92rem 1.5rem;
  background: linear-gradient(135deg, var(--p) 0%, var(--pd) 100%);
  color: #fff; border: none; border-radius: var(--ri);
  font-size: .93rem; font-weight: 700; letter-spacing: .3px;
  cursor: pointer; transition: all .22s ease; box-shadow: var(--sbtn);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 1.35rem; font-family: 'Inter', sans-serif;
}
.btn-login-elite:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37,99,235,.36); }
.btn-login-elite:active { transform: translateY(0); }
.btn-login-elite:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ── CARD FOOTER ──────────────────────────────────────────────────── */
.card-footer-section {
  background: var(--s50); border-top: 1px solid var(--border);
  padding: 1.4rem 2.25rem 1.6rem;
}
.quick-label {
  font-size: .61rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--s400); text-align: center; margin-bottom: .8rem;
}
.role-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.role-pill {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; font-size: .75rem; font-weight: 600; color: var(--s500);
  cursor: pointer; transition: all .18s ease; font-family: 'Inter', sans-serif;
  user-select: none;
}
.role-pill i { font-size: .86rem; }
.role-pill:hover {
  border-color: var(--p); color: var(--p); background: var(--plight);
  transform: translateY(-1px); box-shadow: 0 4px 10px rgba(37,99,235,.1);
}
.role-pill.doctor:hover  { border-color: var(--a);  color: var(--a);  background: var(--alight); }
.role-pill.recep:hover   { border-color: #7c3aed;   color: #7c3aed;   background: #f5f3ff; }
.role-pill.display:hover { border-color: #d97706;   color: #d97706;   background: #fef3c7; }
.role-pill.admin:hover   { border-color: #e11d48;   color: #e11d48;   background: #ffe4e6; }

.system-tag {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 1.1rem; font-size: .67rem; font-weight: 500; color: var(--s400);
}
.system-tag i { color: #22c55e; }

/* ── ANIMATION ────────────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FIELD VALIDATION STATES ─────────────────────────────────────── */
.field-wrap.is-error {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}
.field-wrap.is-error .field-icon { color: #ef4444 !important; opacity: .7; }

.field-wrap.is-ok {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}
.field-wrap.is-ok .field-icon { color: #22c55e !important; opacity: .7; }

/* Subdomain wrapper mirrors field-wrap states */
.subdomain-wrap.is-error {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}
.subdomain-wrap.is-ok {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}

/* Plain bordered inputs (signup uses non-.field-wrap inputs) */
input.is-error,
select.is-error {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
  outline: none;
}
input.is-ok,
select.is-ok {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}

/* Inline field error message — no icon font dependency */
.field-msg {
  font-size: .7rem; font-weight: 600; color: #ef4444;
  margin-top: 5px; display: none;
  align-items: center; gap: 6px; line-height: 1.3;
}
.field-msg::before {
  content: '';
  width: 6px; height: 6px;
  background: #ef4444; border-radius: 50%;
  flex-shrink: 0; margin-top: 1px;
}

/* Password strength bar */
.pw-strength-bar {
  height: 3px; border-radius: 2px; margin-top: 6px;
  background: #e2e8f0; overflow: hidden;
}
.pw-strength-fill {
  height: 100%; width: 0%; border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}

/* ── TOAST ────────────────────────────────────────────────────────── */
.clinical-toast { border-radius: 16px !important; box-shadow: 0 12px 40px rgba(15,23,42,.1) !important; border: 1px solid var(--border) !important; background: #fff !important; }
.clinical-toast-title { font-family: 'Inter', sans-serif !important; font-weight: 600 !important; font-size: .9rem !important; color: var(--s900) !important; }

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { min-height: 100vh; padding: 2.5rem 1.25rem; align-items: flex-start; padding-top: 3rem; }
}
@media (max-width: 480px) {
  .card-inner { padding: 1.75rem 1.5rem 1.5rem; }
  .card-footer-section { padding: 1.25rem 1.5rem 1.5rem; }
  .card-title { font-size: 1.45rem; }
  .float-cards { grid-template-columns: 1fr; }
}
