/* ════════════════════════════════════════════════════════════════════
   WAAREE MIS — SIGN-IN / VERIFY
   Golden-hour solar field (login-art.svg) behind a dark frosted-glass card.
   Shared by login.html and verify.html. Tokens mirror design-system/waaree-mis.
   ════════════════════════════════════════════════════════════════════ */

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

:root {
  color-scheme: dark;

  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* night canvas */
  --night: #08090B;
  --ink: #16171B;

  /* glass + text on glass */
  --glass: rgba(14, 15, 19, .46);
  --glass-line: rgba(255, 255, 255, .12);
  --g-text: #F4F1EA;
  --g-text-2: rgba(244, 241, 234, .74);
  --g-muted: rgba(244, 241, 234, .62);
  --g-faint: rgba(244, 241, 234, .38);
  --g-field: rgba(255, 255, 255, .055);
  --g-field-hover: rgba(255, 255, 255, .08);
  --g-field-line: rgba(255, 255, 255, .15);

  /* champagne — the brass accent, lifted for a dark ground */
  --champagne: #E2C48E;
  --champagne-hi: #ECD4A8;
  --champagne-ring: rgba(226, 196, 142, .18);
  --brass: #8A6534;

  --danger-text: #F6BDB6;
  --danger-line: #E07A70;
  --danger-fill: rgba(214, 96, 84, .14);

  --radius: 12px;
  --radius-card: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--g-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scene ─────────────────────────────────────────────────────────── */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene-art {
  position: absolute;
  inset: -3%;
  background: var(--night) url('/vendor/login-art.svg') 62% 58% / cover no-repeat;
  transform-origin: 55% 46%;
  animation: scene-drift 48s ease-in-out infinite alternate;
}
@keyframes scene-drift { from { transform: scale(1); } to { transform: scale(1.05); } }
/* left-side shade keeps the headline legible; top/bottom shade frames the page */
.scene-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 8, 11, .9) 0%, rgba(7, 8, 11, .62) 32%, rgba(7, 8, 11, .08) 60%, rgba(7, 8, 11, 0) 100%),
    linear-gradient(180deg, rgba(7, 8, 11, .7) 0%, rgba(7, 8, 11, 0) 20%, rgba(7, 8, 11, 0) 72%, rgba(7, 8, 11, .78) 100%);
}
.scene-grain {
  position: absolute;
  inset: 0;
  opacity: .08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ── Page frame ────────────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(32px, 7vw, 128px);
}

.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g-text-2);
}
.mark::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--champagne);
  box-shadow: 0 0 0 4px rgba(226, 196, 142, .14), 0 0 18px rgba(226, 196, 142, .55);
}
.mark-sub {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .16);
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--g-muted);
}
.clock {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--g-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Story (left) ──────────────────────────────────────────────────── */
.story {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  max-width: 600px;
  padding: 48px 0 9vh;
}
.story-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--champagne);
}
.story-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.story-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(46px, 5.6vw, 82px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: #F7F3EB;
  text-wrap: balance;
}
.story-title em {
  font-style: italic;
  color: var(--champagne);
}
.story-copy {
  margin-top: 22px;
  max-width: 460px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--g-text-2);
}
.story-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.story-facts li {
  flex: 1 1 140px;
  padding: 16px 20px 0 0;
}
.story-facts li + li { padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, .1); }
.fact-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--champagne);
}
.fact-v {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--g-muted);
}

/* ── Glass card (right) ────────────────────────────────────────────── */
.card {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 40px;
  border-radius: var(--radius-card);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .04) 36%, rgba(255, 255, 255, .015) 64%, rgba(255, 255, 255, .06) 100%),
    var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid var(--glass-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 40px 100px -30px rgba(0, 0, 0, .8),
    0 0 0 1px rgba(0, 0, 0, .25);
  animation: card-in .7s var(--ease) both .1s;
}
/* warm light catching the top-left edge of the glass */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 226, 174, .6), rgba(255, 255, 255, .1) 28%, rgba(255, 255, 255, 0) 56%, rgba(255, 226, 174, .22) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(18, 19, 23, .92); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand img { display: block; height: 32px; width: auto; }
.secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--g-muted);
}
.rule {
  border: 0;
  height: 1px;
  margin: 26px -40px 30px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .14) 20%, rgba(255, 255, 255, .14) 80%, rgba(255, 255, 255, 0));
}

.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--g-muted);
}
.eyebrow-sep { color: var(--g-faint); }
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: #FBF8F2;
  margin-bottom: 10px;
}
.lede, .blurb {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--g-text-2);
  margin-bottom: 28px;
}
.blurb strong { color: var(--g-text); font-weight: 600; }

/* ── Error note ── */
.alert-error {
  position: relative;
  margin-bottom: 22px;
  padding: 11px 14px 11px 40px;
  border-radius: 10px;
  background: var(--danger-fill);
  border: 1px solid rgba(224, 122, 112, .28);
  color: var(--danger-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.alert-error::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  width: 16px;
  height: 16px;
  background: var(--danger-line);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center / contain no-repeat;
}

/* ── Fields ── */
.field { margin-bottom: 18px; }
.field-last { margin-bottom: 26px; }
.field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--g-muted);
}
.input-wrap { position: relative; }
.input-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--g-faint);
  pointer-events: none;
  transition: color .15s var(--ease);
}
.input-wrap:focus-within .input-ico { color: var(--champagne); }
.field input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: var(--g-field);
  color: var(--g-text);
  border: 1px solid var(--g-field-line);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input-wrap.has-ico input { padding-left: 44px; }
.input-wrap.has-toggle input { padding-right: 50px; }
.field input::placeholder { color: var(--g-faint); opacity: 1; }
.field input:hover { border-color: rgba(255, 255, 255, .26); }
.field input:focus {
  border-color: rgba(226, 196, 142, .9);
  background: var(--g-field-hover);
  box-shadow: 0 0 0 4px var(--champagne-ring);
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--g-text);
  caret-color: var(--g-text);
  box-shadow: 0 0 0 100px #1B1B1F inset;
  border-color: var(--g-field-line);
}
.field input:-webkit-autofill:focus { box-shadow: 0 0 0 100px #1B1B1F inset, 0 0 0 4px var(--champagne-ring); border-color: rgba(226, 196, 142, .9); }
.field input::-ms-reveal, .field input::-ms-clear { display: none; }

/* Verification code */
.field input#code {
  height: 64px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .55em;
  padding-left: calc(16px + .55em);
}
.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--g-muted);
}

/* Password show / hide */
.pw-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--g-muted);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.pw-toggle:hover { background: rgba(255, 255, 255, .08); color: var(--g-text); }
.pw-toggle:focus-visible { outline: 2px solid var(--champagne); outline-offset: -2px; }
.pw-toggle svg { display: block; }
.pw-toggle .i-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .i-eye { display: none; }
.pw-toggle[aria-pressed="true"] .i-eye-off { display: block; }

/* Trust-this-browser checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 24px;
  font-size: 13.5px;
  color: var(--g-text-2);
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--champagne);
  cursor: pointer;
}
.checkbox-row label { cursor: pointer; }

/* ── Primary button ── */
.btn {
  position: relative;
  width: 100%;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  background: var(--champagne);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 14px 34px -14px rgba(226, 196, 142, .7);
  transition: background-color .15s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease), opacity .15s var(--ease);
}
.btn:hover { background: var(--champagne-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 18px 40px -14px rgba(226, 196, 142, .85); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--g-text); outline-offset: 3px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--champagne); }
.btn-idle, .btn-busy { display: inline-flex; align-items: center; gap: 10px; }
.btn-busy { display: none; }
.btn:disabled .btn-idle { display: none; }
.btn:disabled .btn-busy { display: inline-flex; }
.btn .arrow { transition: transform .15s var(--ease); }
.btn:hover:not(:disabled) .arrow { transform: translateX(3px); }
.spinner {
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-note, .resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--g-muted);
  text-align: center;
}
.resend-row a {
  color: var(--champagne);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(226, 196, 142, .35);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.resend-row a:hover { color: var(--champagne-hi); border-color: var(--champagne-hi); }
.resend-row a:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 2px; }

/* ── Footer ── */
.foot {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--g-faint);
}

/* ── Entrance (story) ── */
.story > * { animation: rise .8s var(--ease) both; }
.story > :nth-child(2) { animation-delay: .08s; }
.story > :nth-child(3) { animation-delay: .16s; }
.story > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); column-gap: 40px; }
  .story-facts { display: none; }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    justify-items: center;
    padding: 20px 16px;
  }
  .scene-art { background-position: 66% 50%; }
  .scene-shade { background: linear-gradient(180deg, rgba(7, 8, 11, .72) 0%, rgba(7, 8, 11, .25) 40%, rgba(7, 8, 11, .65) 100%); }
  .top { width: 100%; }
  .mark-sub { display: none; }
  .story { grid-column: 1; grid-row: 2; align-self: start; padding: 36px 0 24px; text-align: center; }
  .story-eyebrow, .story-copy { display: none; }
  .story-title { font-size: clamp(34px, 8vw, 48px); }
  .card { grid-column: 1; grid-row: 3; align-self: start; max-width: 440px; }
  .foot { width: 100%; justify-content: center; flex-wrap: wrap; text-align: center; }
}
@media (max-width: 480px) {
  .card { padding: 28px 22px; border-radius: 18px; }
  .rule { margin: 22px -22px 24px; }
  .title { font-size: 38px; }
  .clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-art, .card, .story > *, .spinner { animation: none; }
  .btn, .btn .arrow, .field input, .pw-toggle, .input-ico { transition: none; }
}
