/* Theós Financial — borrower login theme (apply.jakelo.com).
   Matches the application wizard: dark-first, indigo accent, glassy card on an
   ambient gradient. Cutting-edge feel + explicit trust cues. Light/auto/dark via
   data-theme (auto follows the OS); choice shared with the app in localStorage. */

:root{
  /* Light is the default look; dark is opt-in via the toggle (data-theme="dark"). */
  --bg:#eef1f7; --bg-2:#e6eaf3;
  --panel:rgba(255,255,255,.86); --panel-solid:#ffffff;
  --line:rgba(20,28,60,.12); --line-2:rgba(20,28,60,.07);
  --ink:#101623; --muted:#5b6479; --faint:#8b93a6;
  --field:#ffffff; --field-line:#d3d9e6;
  --accent:#3b4fe4; --accent-2:#2b3bc4; --accent-soft:rgba(59,79,228,.10);
  --ok:#10b981; --danger:#e5484d; --danger-soft:rgba(229,72,77,.10);
  --radius:20px; --radius-sm:12px;
  --font:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}
:root[data-theme="dark"]{
  --bg:#0b0e16; --bg-2:#0e1220;
  --panel:rgba(20,26,40,.72); --panel-solid:#121724;
  --line:rgba(255,255,255,.10); --line-2:rgba(255,255,255,.06);
  --ink:#eef1f8; --muted:#9aa2b6; --faint:#727b90;
  --field:#161c2b; --field-line:#2c3448;
  --accent:#6c7dff; --accent-2:#8a97ff; --accent-soft:rgba(108,125,255,.16);
  --ok:#34d399; --danger:#f0616d; --danger-soft:rgba(240,97,109,.14);
}

*{margin:0;padding:0;box-sizing:border-box}
body{
  min-height:100vh; font-family:var(--font); color:var(--ink);
  background:var(--bg); position:relative; overflow-x:hidden;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  display:flex; align-items:center; justify-content:center; padding:1.5rem;
}
/* ambient gradient field */
body::before, body::after{
  content:""; position:fixed; border-radius:50%; filter:blur(90px); opacity:.55; z-index:0;
  pointer-events:none; animation:drift 22s ease-in-out infinite alternate;
}
body::before{ width:60vw; height:60vw; left:-18vw; top:-22vh;
  background:radial-gradient(circle at 30% 30%, rgba(108,125,255,.55), transparent 62%); }
body::after{ width:52vw; height:52vw; right:-16vw; bottom:-20vh;
  background:radial-gradient(circle at 60% 60%, rgba(52,211,153,.30), transparent 60%); animation-delay:-8s; }
@keyframes drift{ from{transform:translate3d(0,0,0) scale(1)} to{transform:translate3d(2.5rem,1.5rem,0) scale(1.08)} }
@media (prefers-reduced-motion: reduce){ body::before, body::after{ animation:none } }

/* theme toggle */
.theme-toggle{
  position:fixed; top:1.1rem; right:1.2rem; z-index:10; width:40px; height:40px;
  display:grid; place-items:center; border-radius:11px; border:1px solid var(--field-line);
  background:var(--panel); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  color:var(--muted); cursor:pointer; transition:.15s;
}
.theme-toggle:hover{ color:var(--ink); border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft) }
.theme-toggle svg{ width:19px; height:19px }
.theme-toggle .ic-moon{ display:none }
:root[data-theme="dark"] .theme-toggle .ic-moon{ display:block } :root[data-theme="dark"] .theme-toggle .ic-sun{ display:none }

/* layout */
.auth{ position:relative; z-index:1; width:100%; display:flex; justify-content:center }
.auth__grid{
  width:100%; max-width:920px; display:grid; grid-template-columns:1.05fr .95fr;
  background:var(--panel); backdrop-filter:blur(20px) saturate(120%); -webkit-backdrop-filter:blur(20px) saturate(120%);
  border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
  box-shadow:0 40px 90px -40px rgba(0,0,0,.6);
}

/* brand + trust panel */
.auth__aside{ position:relative; padding:2.6rem 2.4rem; overflow:hidden;
  background:linear-gradient(160deg, rgba(108,125,255,.16), rgba(108,125,255,.02) 55%);
  border-right:1px solid var(--line-2); display:flex; align-items:center }
.aside__glow{ position:absolute; width:24rem; height:24rem; left:-8rem; bottom:-10rem; border-radius:50%;
  background:radial-gradient(circle, rgba(108,125,255,.45), transparent 60%); filter:blur(50px); opacity:.7 }
.aside__inner{ position:relative; z-index:1 }
.brand{ display:flex; align-items:center; gap:.6rem; margin-bottom:2rem }
.brand__mark{ width:36px; height:36px; border-radius:10px; display:grid; place-items:center; font-weight:800; color:#fff;
  background:linear-gradient(150deg,var(--accent),var(--accent-2)); box-shadow:0 8px 20px -8px var(--accent) }
.brand__name{ font-weight:700; letter-spacing:-.01em; font-size:1.02rem }
.aside__head{ font-size:1.6rem; line-height:1.18; font-weight:700; letter-spacing:-.03em; text-wrap:balance; margin-bottom:1.6rem }
.trust{ list-style:none; display:flex; flex-direction:column; gap:.9rem }
.trust li{ display:flex; align-items:flex-start; gap:.65rem; font-size:.9rem; color:var(--muted); line-height:1.4 }
.trust__ic{ flex:none; width:26px; height:26px; border-radius:8px; display:grid; place-items:center;
  background:var(--accent-soft); color:var(--accent) }
.trust__ic svg{ width:15px; height:15px }

/* form card */
.auth__card{ padding:2.6rem 2.4rem; display:flex; flex-direction:column }
.auth__title{ font-size:1.5rem; font-weight:700; letter-spacing:-.03em }
.auth__subtitle{ color:var(--muted); font-size:.92rem; margin:.4rem 0 1.5rem }
.auth__form{ display:flex; flex-direction:column; gap:1rem }
.auth__row2{ display:grid; grid-template-columns:1fr 1fr; gap:1rem }
.field{ display:flex; flex-direction:column; gap:.4rem; min-width:0 }
.field__label{ font-size:.82rem; font-weight:560; color:var(--ink) }
.field__hint{ font-size:.8rem; color:var(--faint) }
.field__err{ font-size:.78rem; font-weight:600; color:var(--danger) }
.field__input{
  width:100%; background:var(--field); border:1px solid var(--field-line); color:var(--ink);
  border-radius:var(--radius-sm); padding:.75rem .85rem; font:inherit; font-size:.95rem;
  transition:border-color .15s, box-shadow .15s;
}
.field__input::placeholder{ color:var(--faint) }
.field__input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft) }

.auth__row{ display:flex } .auth__row--end{ justify-content:flex-end; margin-top:-.3rem }
.auth__link{ color:var(--accent); font-size:.85rem; font-weight:600; text-decoration:none }
.auth__link:hover{ text-decoration:underline }
.auth__link--strong{ color:var(--accent-2) }
.auth__alt{ margin-top:1.2rem; font-size:.88rem; color:var(--muted) }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:.5rem; width:100%;
  border:0; border-radius:var(--radius-sm); font:inherit; font-weight:650; font-size:.98rem; padding:.85rem 1.2rem;
  cursor:pointer; transition:transform .12s, box-shadow .15s, filter .15s; margin-top:.4rem }
.btn--primary{ color:#fff; background:linear-gradient(180deg, color-mix(in srgb,var(--accent) 92%,#fff), var(--accent));
  box-shadow:0 12px 26px -12px var(--accent) }
.btn--primary:hover{ filter:brightness(1.05); box-shadow:0 16px 32px -12px var(--accent) }
.btn--primary:active{ transform:translateY(1px) }
.btn__glyph{ transition:transform .15s } .btn:hover .btn__glyph{ transform:translateX(3px) }

/* social login */
.social{ display:flex; flex-direction:column; gap:.6rem; margin-bottom:1.1rem }
.social-btn{ display:flex; align-items:center; justify-content:center; gap:.6rem; width:100%;
  padding:.72rem 1rem; border-radius:var(--radius-sm); border:1px solid var(--field-line);
  background:var(--panel-solid); color:var(--ink); font:inherit; font-weight:600; font-size:.92rem;
  text-decoration:none; cursor:pointer; transition:border-color .15s, box-shadow .15s }
.social-btn:hover{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft) }
.social-btn__logo{ width:18px; height:18px; flex:none; display:inline-block }
.divider{ display:flex; align-items:center; gap:.8rem; color:var(--faint); font-size:.78rem; margin:0 0 1.1rem }
.divider::before, .divider::after{ content:""; flex:1; height:1px; background:var(--line) }

.auth__notice{ padding:.7rem .9rem; border-radius:var(--radius-sm); font-size:.86rem; line-height:1.4; margin-bottom:1rem;
  background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 30%,transparent); color:var(--ink) }
.auth__notice--error{ background:var(--danger-soft); border-color:color-mix(in srgb,var(--danger) 40%,transparent) }

.auth__foot{ display:flex; align-items:center; gap:.5rem; margin-top:1.6rem; padding-top:1.2rem;
  border-top:1px solid var(--line-2); color:var(--faint); font-size:.8rem }
.auth__chip{ width:14px; height:14px; flex:none; border-radius:4px; background:var(--ok);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center/contain no-repeat }

/* TOTP setup / QR (inherited pages) */
.auth__qr{ text-align:center; margin:0 0 1.2rem }
.auth__qr-img{ width:180px; height:180px; border-radius:12px; background:#fff; padding:8px; border:1px solid var(--line) }
.auth__secret{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.88rem; letter-spacing:.06em;
  word-break:break-all; background:var(--field); border:1px solid var(--field-line); border-radius:8px; padding:.5rem .7rem; margin-top:.4rem; color:var(--ink) }

/* single-card (inherited) pages center without the split grid */
.auth > .auth__card{ width:100%; max-width:440px; background:var(--panel); backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 40px 90px -40px rgba(0,0,0,.6) }
.auth > .auth__card .auth__brand{ display:flex; align-items:center; gap:.6rem; margin-bottom:1.4rem }
.auth__mark{ width:32px; height:32px; border-radius:9px; background:linear-gradient(150deg,var(--accent),var(--accent-2)) }
.auth__org{ font-weight:700 }

/* responsive: stack, hide the trust panel body on small screens */
@media (max-width:760px){
  .auth__grid{ grid-template-columns:1fr; max-width:440px }
  .auth__aside{ padding:1.8rem 1.8rem 1.4rem; border-right:0; border-bottom:1px solid var(--line-2) }
  .aside__head{ font-size:1.3rem; margin-bottom:1.1rem }
  .trust{ gap:.6rem } .trust li{ font-size:.85rem }
  .auth__card{ padding:1.8rem }
  .auth__row2{ grid-template-columns:1fr }
}
