/* ================================================================
   Sign-in — standalone stylesheet.

   Deliberately not the dashboard's styles.css: this page is served
   before authentication, so it carries only the tokens it needs
   rather than exposing the whole application's CSS to anyone who
   loads the login screen.
   ================================================================ */
:root, html[data-theme="light"]{
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --border: #dde3e9;
  --text: #17232c;
  --text-dim: #55636f;
  --text-faint: #8794a1;
  --accent: #196f82;
  --accent-dim: #124f5d;
  --accent-soft: rgba(25,111,130,.10);
  --red: #c14a3d;
  --red-soft: rgba(193,74,61,.10);
  --brand: #62bc45;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(23,35,44,.04), 0 8px 20px -12px rgba(23,35,44,.14);
}
html[data-theme="dark"]{
  --bg: #10161d;
  --surface: #171f28;
  --surface-2: #1e2733;
  --border: #2c3946;
  --text: #eef2f5;
  --text-dim: #8b97a3;
  --text-faint: #576270;
  --accent: #49b2ca;
  --accent-dim: #2e8698;
  --accent-soft: rgba(73,178,202,.16);
  --red: #e2685a;
  --red-soft: rgba(226,104,90,.14);
  --brand: #62bc45;
  --shadow-card: none;
}

*{ box-sizing:border-box; }
html, body{ margin:0; height:100%; }
body{
  background:var(--bg); color:var(--text);
  font-family:"Plus Jakarta Sans",-apple-system,"Segoe UI","Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }

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

/* ---- left: estate imagery ---- */
.auth-visual{ position:relative; overflow:hidden; display:flex; align-items:flex-end;
  padding:48px; background:#0d1712; }
.auth-photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* the gradient is what makes white text legible over a photograph whose
   brightness varies wildly across the frame */
.auth-visual::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(105deg, rgba(8,20,14,.92) 0%, rgba(8,20,14,.74) 42%, rgba(8,20,14,.35) 100%);
}
.auth-visual-inner{ position:relative; z-index:1; max-width:440px; }
.auth-logo{ display:block; width:auto; height:40px; margin-bottom:34px; }
.auth-headline{ margin:0; font-size:38px; line-height:1.1; font-weight:800; letter-spacing:-.03em; color:#fff; }
.auth-lede{ margin:12px 0 0; font-size:14.5px; line-height:1.55; color:rgba(255,255,255,.78); max-width:38ch; }
.auth-points{ list-style:none; margin:30px 0 0; padding:0; display:flex; flex-direction:column; gap:11px; }
.auth-points li{ position:relative; padding-left:24px; font-size:13px; line-height:1.5; color:rgba(255,255,255,.72); }
.auth-points li::before{
  content:""; position:absolute; left:0; top:6px; width:7px; height:7px; border-radius:50%;
  background:var(--brand); box-shadow:0 0 0 3px rgba(98,188,69,.22);
}
.auth-credit{ margin:44px 0 0; font-size:11px; letter-spacing:.03em; color:rgba(255,255,255,.5); }
.auth-credit strong{ color:rgba(255,255,255,.8); font-weight:700; }

/* ---- right: the form ---- */
.auth-panel{ display:flex; align-items:center; justify-content:center; padding:48px 40px; background:var(--surface); }
.auth-form-wrap{ width:100%; max-width:372px; }
.auth-logo-sm{ display:none; margin-bottom:26px; }
.auth-logo-sm img{ display:block; width:auto; height:32px; }
/* CIC navy vanishes on the dark surface, so dark theme takes the white logo */
html[data-theme="dark"] .auth-logo-sm .on-light, .auth-logo-sm .on-dark{ display:none; }
html[data-theme="dark"] .auth-logo-sm .on-dark{ display:block; }
.auth-title{ margin:0; font-size:26px; font-weight:800; letter-spacing:-.025em; }
.auth-sub{ margin:8px 0 0; font-size:13px; line-height:1.55; color:var(--text-dim); }

.auth-error{
  display:flex; align-items:flex-start; gap:9px; margin:22px 0 0; padding:11px 13px;
  background:var(--red-soft); border:1px solid color-mix(in srgb, var(--red) 34%, transparent);
  border-radius:var(--radius-sm); color:var(--red); font-size:12.5px; font-weight:600; line-height:1.45;
}
.auth-error svg{ flex:none; margin-top:1px; }

.auth-form{ margin-top:26px; display:flex; flex-direction:column; gap:17px; }
.field{ display:flex; flex-direction:column; gap:7px; }
.field-label{ font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-dim); }
.field-input{
  width:100%; font:inherit; font-size:14px; color:var(--text);
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:12px 13px; min-height:46px; transition:border-color .15s, background .15s, box-shadow .15s;
}
.field-input:focus{ outline:none; border-color:var(--accent); background:var(--surface);
  box-shadow:0 0 0 3px var(--accent-soft); }
.field-input:-webkit-autofill{ -webkit-text-fill-color:var(--text); -webkit-box-shadow:0 0 0 40px var(--surface-2) inset; }

.field-password{ position:relative; }
.field-password .field-input{ padding-right:46px; }
.pw-toggle{
  position:absolute; right:5px; top:50%; transform:translateY(-50%);
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; border-radius:8px; color:var(--text-faint);
  cursor:pointer; transition:color .15s, background .15s;
}
.pw-toggle:hover{ color:var(--accent); background:var(--accent-soft); }
.field-hint{ margin:0; font-size:11.5px; font-weight:600; color:var(--text-dim); }

.auth-submit{
  position:relative; margin-top:6px; min-height:46px; width:100%;
  display:flex; align-items:center; justify-content:center; gap:9px;
  font:inherit; font-size:14px; font-weight:700; color:#fff; cursor:pointer;
  background:linear-gradient(155deg, var(--accent), var(--accent-dim));
  border:none; border-radius:var(--radius-sm);
  transition:filter .15s, transform .12s;
}
.auth-submit:hover{ filter:brightness(1.07); }
.auth-submit:active{ transform:translateY(1px); }
.auth-submit:disabled{ cursor:default; filter:saturate(.6) brightness(.95); }
.auth-spinner{
  display:none; width:15px; height:15px; border-radius:50%;
  border:2px solid rgba(255,255,255,.35); border-top-color:#fff;
  animation:auth-spin .7s linear infinite;
}
.auth-submit.is-busy .auth-spinner{ display:block; }
.auth-submit.is-busy .auth-submit-label{ opacity:.85; }
@keyframes auth-spin{ to{ transform:rotate(360deg); } }

.auth-foot{ margin:26px 0 0; padding-top:18px; border-top:1px solid var(--border);
  font-size:11.5px; line-height:1.55; color:var(--text-faint); }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ---- narrow: the photograph becomes a header band, the form leads ---- */
@media (max-width:900px){
  .auth{ grid-template-columns:1fr; min-height:100dvh; }
  .auth-visual{ display:none; }
  .auth-logo-sm{ display:block; }
  .auth-panel{ align-items:flex-start; padding:40px 22px; background:var(--bg); }
  .auth-form-wrap{ max-width:420px; margin:0 auto; padding:26px 22px 24px;
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius); box-shadow:var(--shadow-card); }
}
@media (max-width:420px){
  .auth-panel{ padding:24px 14px; }
  .auth-title{ font-size:23px; }
}
