/* ==========================================================================
   HITL — sign-in screen
   Invoice AI Workspace (HITL + Agentic AI). Light theme, brand-aligned.
   ========================================================================== */

:root {
  --bg-app:         #eef2f5;
  --blue-pale-2:    #e8f4fa;
  --blue-border:    #bcdcec;
  --blue:           #2f8fd4;
  --blue-dark:      #1f6fb8;
  --teal:           #0d8f9e;
  --teal-dark:      #0a7482;
  --green:          #2db55d;
  --green-cta:      #0aa14f;
  --green-cta-dark: #0a8a44;
  --red:            #d64545;
  --border:         #dbe4ea;
  --input-bg:       #f3f6f9;
  --input-border:   #e2e9ee;
  --text:           #17232e;
  --text-mid:       #47566180;
  --text-mid2:      #4b5b67;
  --text-soft:      #74858f;
  --radius:         12px;
  --font: "Inter", "Segoe UI", "Open Sans", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

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

.login-body {
  font-family: var(--font);
  color: var(--text);
  background: #f4f8f8;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   Background
   ========================================================================== */

.bg-deco { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-deco .blob { position: absolute; border-radius: 50%; filter: blur(70px); }
.bg-deco .b1 { width: 44vmax; height: 44vmax; right: -12vmax; top: -10vmax; background: radial-gradient(circle at 40% 40%, rgba(120,200,230,.28), transparent 62%); }
.bg-deco .b2 { width: 40vmax; height: 40vmax; left: -14vmax; bottom: -16vmax; background: radial-gradient(circle at 50% 50%, rgba(150,214,122,.30), transparent 62%); }
.bg-deco .b3 { width: 34vmax; height: 34vmax; right: 4vmax; bottom: -14vmax; background: radial-gradient(circle at 50% 50%, rgba(120,210,180,.24), transparent 62%); }
.bg-deco .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right,  rgba(31,66,90,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31,66,90,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 100% 90% at 50% 40%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 100% 90% at 50% 40%, #000 45%, transparent 100%);
}

/* ==========================================================================
   Shell
   ========================================================================== */

.login-shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 24px;
  align-items: center;
  padding: 32px clamp(24px, 4vw, 64px);
  max-width: 1560px; margin: 0 auto;
}

/* ==========================================================================
   Left — brand panel
   ========================================================================== */

.brand-panel { position: relative; display: flex; flex-direction: column; gap: 30px; min-height: 88vh; justify-content: space-between; padding: 8px 0; }

.bp-top { display: flex; align-items: center; gap: 20px; flex: none; }
.bp-div { width: 1px; height: 32px; background: #cdd8de; }

/* illustration sits behind/right of the copy */
.hero-illo { position: absolute; right: -4%; top: 46%; transform: translateY(-50%); width: min(460px, 42%); opacity: .96; pointer-events: none; z-index: 0; }
.hero-illo svg { width: 100%; height: auto; }

.bp-center { position: relative; z-index: 1; max-width: 700px; }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-dark);
  background: #e6f0fb;
  border: 1px solid #cfe3f6;
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 24px;
}
.kicker svg { width: 15px; height: 15px; color: var(--blue); }

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(34px, 3.7vw, 54px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.025em;
  color: var(--text);
}
.g-blue {
  background: linear-gradient(92deg, #2b8fd4, #17a8cf);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.g-green {
  background: linear-gradient(92deg, #1f9f8e, #4fb84a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

.lead {
  margin: 0 0 34px;
  max-width: 40ch;
  font-size: 16px; line-height: 1.6; color: var(--text-mid2);
}

.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; max-width: 440px; }
.feature-list li {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 500; color: #2c3a45;
  padding-bottom: 15px; border-bottom: 1px solid #e5ecef;
}
.feature-list li:last-child { border-bottom: 0; }
.feature-list .fi {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: #fff;
  box-shadow: 0 6px 16px -8px rgba(24,48,66,.28), 0 1px 0 rgba(255,255,255,.9) inset;
  border: 1px solid #eef3f5;
}
.feature-list .fi svg { width: 22px; height: 22px; }
.feature-list .fi.blue  { color: var(--blue); }
.feature-list .fi.green { color: #24a35f; }
.feature-list .fi.teal  { color: #1fa39a; }

.bp-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-soft); flex: none;
}
.bp-foot svg { width: 16px; height: 16px; color: #59a37a; }

/* ==========================================================================
   Right — sign-in card
   ========================================================================== */

.auth-panel { display: flex; align-items: center; justify-content: center; }

.auth-card {
  position: relative;
  width: 100%; max-width: 460px;
  background: #fff;
  border-radius: 22px;
  padding: 38px 40px 30px;
  box-shadow: 0 40px 90px -40px rgba(24,60,80,.4), 0 6px 24px -14px rgba(24,48,66,.18);
  border: 1px solid #eef3f5;
}
/* faint gradient outline */
.auth-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 22px; padding: 1px;
  background: linear-gradient(150deg, rgba(47,143,212,.5), rgba(45,181,93,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .5; pointer-events: none;
}
.auth-card > * { position: relative; z-index: 1; }

.auth-brand { display: none; margin-bottom: 18px; }

.secure-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-dark);
  background: #eef4fb;
  border: 1px solid #dce8f5;
  border-radius: 999px; padding: 6px 13px;
}
.secure-pill svg { width: 14px; height: 14px; }

.auth-card h2 { margin: 18px 0 5px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 26px; font-size: 14.5px; color: var(--text-soft); }

/* ---------- form ---------- */

.auth-form { display: flex; flex-direction: column; gap: 17px; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.fg-label { font-size: 13px; font-weight: 600; color: #33424d; }

.fg-control {
  position: relative; display: flex; align-items: center;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.fg-control:focus-within { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,143,212,.14); }
.fg-ico { width: 19px; height: 19px; color: #93a3ad; margin: 0 10px 0 13px; flex: none; }
.fg-control input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--text); padding: 14px 12px 14px 0;
}
.fg-control input::placeholder { color: #a4b2bb; }

.fg-select {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 14px 34px 14px 0; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.fg-chev { position: absolute; right: 12px; width: 18px; height: 18px; color: #8a9aa4; pointer-events: none; }

.pw-toggle {
  flex: none; display: grid; place-items: center; width: 42px; height: 44px; margin-right: 3px;
  border: 0; background: transparent; cursor: pointer; color: #93a3ad; border-radius: var(--radius);
}
.pw-toggle:hover { color: var(--blue-dark); }
.pw-toggle svg { width: 19px; height: 19px; }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.remember { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: #3a4750; cursor: pointer; user-select: none; }
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.rm-box {
  width: 19px; height: 19px; border-radius: 6px; border: 1.6px solid #c3d0d8; background: #fff;
  display: grid; place-items: center; color: #fff; transition: background .14s, border-color .14s;
}
.rm-box svg { width: 12px; height: 12px; opacity: 0; }
.remember input:checked + .rm-box { background: var(--green-cta); border-color: var(--green-cta); }
.remember input:checked + .rm-box svg { opacity: 1; }
.remember input:focus-visible + .rm-box { box-shadow: 0 0 0 3px rgba(10,161,79,.22); }

.link { font-size: 13.5px; font-weight: 600; color: var(--blue); text-decoration: none; }
.link:hover { color: var(--blue-dark); text-decoration: underline; }

.auth-err[hidden], .aux-msg[hidden] { display: none; }
.auth-form.shake { animation: shake .38s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%,90% { transform: translateX(-1px); } 20%,80% { transform: translateX(2px); } 30%,50%,70% { transform: translateX(-4px); } 40%,60% { transform: translateX(4px); } }

.auth-err {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--red);
  background: rgba(214,69,69,.08); border: 1px solid rgba(214,69,69,.25);
  border-radius: 10px; padding: 9px 12px;
}
.aux-msg {
  font-size: 12.5px; color: var(--text-mid2); line-height: 1.5;
  background: #eef4fb; border: 1px solid #dce8f5; border-radius: 10px; padding: 10px 12px;
}

.signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 3px; min-height: 52px;
  border: 0; border-radius: var(--radius);
  font-family: inherit; font-size: 15.5px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--green-cta), var(--green-cta-dark));
  box-shadow: 0 14px 28px -12px rgba(10,161,79,.65);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.signin-btn svg { width: 19px; height: 19px; transition: transform .18s; }
.signin-btn:hover { filter: brightness(1.05); box-shadow: 0 18px 32px -12px rgba(10,161,79,.75); }
.signin-btn:hover svg { transform: translateX(3px); }
.signin-btn:active { transform: translateY(1px); }
.signin-btn:disabled { opacity: .7; cursor: default; }

.card-foot { display: flex; align-items: center; gap: 7px; margin: 18px 0 0; font-size: 12px; color: #9aa9b2; }
.card-foot svg { width: 14px; height: 14px; color: #a7b4bc; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; padding: 5vh 20px; }
  .brand-panel { display: none; }
  .auth-panel { min-height: 100vh; }
  .auth-brand { display: block; }
}
@media (max-width: 460px) {
  .auth-card { padding: 28px 22px 22px; border-radius: 18px; }
  .auth-card h2 { font-size: 26px; }
}
