/* INTUITONE — Authentication experience (login / password reset / password email).
 *
 * Self-contained. Depends only on the design-system token layer
 * (public/intuitone/tokens.css) and self-hosted Inter (public/intuitone/vendor).
 * No Tailwind, no AdminLTE, no build step — this repo ships CSS as a committed
 * artifact and /public/css is gitignored build output, so the auth screens are
 * styled here in plain, token-driven CSS instead.
 *
 * Layout: a two-zone desktop experience — restrained brand panel (40%) + primary
 * authentication area (60%) — that degrades to a compact branded header on
 * tablet and a deliberately mobile-first single column on phones.
 */

/* ------------------------------------------------------------------ reset */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

.in-auth {
  --auth-brand: linear-gradient(155deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
  --auth-maxw: 420px;
  font-family: var(--in-font, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  color: var(--in-fg, #0f172a);
  background: var(--in-bg, #f8fafc);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
}

.in-auth a { color: var(--in-primary, #1d4ed8); text-decoration: none; }
.in-auth a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ brand panel */
.in-auth__brand {
  flex: 0 0 40%;
  max-width: 40%;
  position: relative;
  overflow: hidden;
  background: var(--auth-brand);
  color: #fff;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* restrained geometric texture, pure CSS — no image request */
.in-auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .10), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(255, 255, 255, .08), transparent 46%),
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  pointer-events: none;
}

.in-auth__brand > * { position: relative; z-index: 1; }

.in-auth__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.01em;
}
.in-auth__wordmark sup { font-size: .5em; font-weight: 600; top: -.9em; }

.in-auth__mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, .14);
  display: grid;
  place-items: center;
}
.in-auth__mark svg { width: 20px; height: 20px; }

.in-auth__kicker {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .72);
}

.in-auth__pitch { max-width: 30ch; }
.in-auth__pitch h1 {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.in-auth__pitch p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
}

.in-auth__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.in-auth__features li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
}
.in-auth__features svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: rgba(255, 255, 255, .7);
}

/* -------------------------------------------------------- authentication */
.in-auth__main {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}

.in-auth__topbar {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.in-auth__topbar a { color: var(--in-fg-muted, #475569); font-weight: 500; }

.in-auth__lang {
  position: relative;
}
.in-auth__lang summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--in-radius-pill, 9999px);
  border: 1px solid var(--in-border, #e2e8f0);
  color: var(--in-fg-muted, #475569);
  font-weight: 500;
  user-select: none;
}
.in-auth__lang summary::-webkit-details-marker { display: none; }
.in-auth__lang[open] summary { border-color: var(--in-border-strong, #cbd5e1); }
.in-auth__lang ul {
  position: absolute;
  right: 0;
  margin-top: 6px;
  padding: 6px;
  list-style: none;
  min-width: 180px;
  background: var(--in-surface, #fff);
  border: 1px solid var(--in-border, #e2e8f0);
  border-radius: var(--in-radius, 8px);
  box-shadow: var(--in-e2, 0 4px 12px rgba(15, 23, 42, .08));
  z-index: 20;
}
.in-auth__lang li > a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--in-radius-sm, 6px);
  color: var(--in-fg, #0f172a);
  font-weight: 500;
  cursor: pointer;
}
.in-auth__lang li > a:hover { background: var(--in-surface-2, #f1f5f9); text-decoration: none; }

/* standalone crest (password screens — no brand panel) */
.in-auth__crest {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  color: var(--in-fg, #0f172a);
}
.in-auth__crest sup { font-size: .5em; font-weight: 600; top: -.9em; }
.in-auth__crest .in-auth__mark { width: 30px; height: 30px; }
.in-auth__crest .in-auth__mark svg { width: 18px; height: 18px; }
.in-auth__back {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

/* card ---------------------------------------------------------------- */
.in-auth__card {
  width: 100%;
  max-width: var(--auth-maxw);
  background: var(--in-surface, #fff);
  border: 1px solid var(--in-border, #e2e8f0);
  border-radius: var(--in-radius-lg, 12px);
  box-shadow: var(--in-e2, 0 4px 12px rgba(15, 23, 42, .08));
  padding: 36px 34px 30px;
}

.in-auth__card-head { text-align: center; margin-bottom: 22px; }
.in-auth__logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  margin: 0 auto 14px;
  background: var(--auth-brand);
  display: grid;
  place-items: center;
}
.in-auth__logo svg { width: 24px; height: 24px; color: #fff; }
.in-auth__card-head h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 4px;
}
.in-auth__card-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--in-fg-muted, #475569);
}

/* alerts ------------------------------------------------------------- */
.in-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--in-radius, 8px);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
}
.in-alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.in-alert--error {
  background: var(--in-danger-bg, #fee2e2);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.in-alert--info {
  background: var(--in-info-bg, #dbeafe);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.in-alert--success {
  background: var(--in-success-bg, #dcfce7);
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* fields ------------------------------------------------------------- */
.in-field { margin-bottom: 16px; }
.in-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.in-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--in-fg, #0f172a);
}
.in-field__link { font-size: 12.5px; font-weight: 500; }

.in-input {
  position: relative;
  display: flex;
  align-items: center;
}
.in-input > svg.in-input__icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--in-fg-subtle, #94a3b8);
  pointer-events: none;
}
.in-input input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--in-fg, #0f172a);
  background: var(--in-surface, #fff);
  border: 1px solid var(--in-border-strong, #cbd5e1);
  border-radius: var(--in-radius, 8px);
  outline: none;
  transition: border-color var(--in-motion, 180ms), box-shadow var(--in-motion, 180ms);
  -webkit-appearance: none;
  appearance: none;
}
.in-input input::placeholder { color: var(--in-fg-subtle, #94a3b8); font-weight: 400; }
.in-input input:hover { border-color: #94a3b8; }
.in-input input:focus-visible,
.in-input input:focus {
  border-color: var(--in-primary, #1d4ed8);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .16);
}
.in-input:has(input:focus) > svg.in-input__icon { color: var(--in-primary, #1d4ed8); }

.in-input input[type="password"],
.in-input input.in-input--has-toggle { padding-right: 46px; }

.in-input__toggle {
  position: absolute;
  right: 6px;
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--in-radius-sm, 6px);
  color: var(--in-fg-subtle, #94a3b8);
  cursor: pointer;
}
.in-input__toggle:hover { color: var(--in-fg-muted, #475569); background: var(--in-surface-2, #f1f5f9); }
.in-input__toggle:focus-visible { outline: 2px solid var(--in-primary, #1d4ed8); outline-offset: 1px; }
.in-input__toggle svg { width: 18px; height: 18px; }
.in-input__toggle .in-eye-off { display: none; }
.in-input__toggle[aria-pressed="true"] .in-eye-off { display: block; }
.in-input__toggle[aria-pressed="true"] .in-eye-on { display: none; }

/* field error state */
.in-field.is-invalid .in-input input {
  border-color: var(--in-danger, #b91c1c);
}
.in-field.is-invalid .in-input input:focus {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .14);
}
.in-field__error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--in-danger, #b91c1c);
}
.in-field__error svg { width: 14px; height: 14px; flex: none; }

/* remember / options row */
.in-auth__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
}
.in-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--in-fg-muted, #475569);
  cursor: pointer;
  user-select: none;
}
.in-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--in-primary, #1d4ed8);
  cursor: pointer;
}

/* primary button */
.in-btn {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  background: var(--in-primary, #1d4ed8);
  border: 0;
  border-radius: var(--in-radius, 8px);
  cursor: pointer;
  transition: background var(--in-motion, 180ms), transform var(--in-motion, 180ms);
}
.in-btn:hover { background: var(--in-primary-hover, #1a44be); }
.in-btn:active { transform: translateY(1px); }
.in-btn:focus-visible { outline: 2px solid var(--in-primary, #1d4ed8); outline-offset: 2px; }
.in-btn[disabled],
.in-btn.is-loading { opacity: .78; cursor: progress; }
.in-btn__spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: in-spin .7s linear infinite;
}
.in-btn.is-loading .in-btn__spinner { display: block; }
.in-btn.is-loading .in-btn__label { opacity: .9; }
@keyframes in-spin { to { transform: rotate(360deg); } }

.in-recaptcha { margin: 4px 0 16px; display: flex; justify-content: center; }

/* secondary / footer */
.in-auth__alt {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--in-border, #e2e8f0);
  text-align: center;
  font-size: 13px;
  color: var(--in-fg-muted, #475569);
}
.in-auth__alt a { font-weight: 600; }

.in-auth__seal {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--in-fg-subtle, #94a3b8);
}

.in-auth__foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--in-fg-subtle, #94a3b8);
}

/* demo shortcuts (demo env only) */
.in-demo {
  width: 100%;
  max-width: var(--auth-maxw);
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--in-surface, #fff);
  border: 1px dashed var(--in-border-strong, #cbd5e1);
  border-radius: var(--in-radius, 8px);
}
.in-demo h2 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--in-fg-muted, #475569); text-transform: uppercase; }
.in-demo__grid { display: flex; flex-wrap: wrap; gap: 8px; }
.in-demo__grid a {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--in-radius-pill, 9999px);
  background: var(--in-primary-50, #eff4ff);
  color: var(--in-primary, #1d4ed8);
}
.in-demo__grid a:hover { background: var(--in-primary-100, #dce7ff); text-decoration: none; }

/* --------------------------------------------------------- responsive */

/* Tablet — brand becomes a slim top band, auth is primary. */
@media (max-width: 1023px) {
  .in-auth { flex-direction: column; }
  .in-auth__brand {
    flex: none;
    max-width: 100%;
    padding: 26px 28px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .in-auth__pitch,
  .in-auth__features { display: none; }
  .in-auth__kicker { margin-top: 2px; }
  .in-auth__main { padding: 36px 24px 48px; }
  .in-auth__topbar { position: static; align-self: flex-end; margin-bottom: 18px; }
}

/* Mobile — deliberate single column; compact header, roomy card. */
@media (max-width: 640px) {
  .in-auth__brand {
    padding: 20px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .in-auth__wordmark { font-size: 19px; }
  .in-auth__mark { width: 30px; height: 30px; }
  .in-auth__main { padding: 26px 16px 40px; }
  .in-auth__card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 8px 4px 0;
    max-width: 440px;
  }
  .in-auth__card-head { margin-bottom: 20px; }
  .in-demo { border-style: solid; }
}

@media (max-width: 360px) {
  .in-auth__main { padding-left: 12px; padding-right: 12px; }
}

/* Large desktop — a touch more generous. */
@media (min-width: 1440px) {
  .in-auth { --auth-maxw: 440px; }
  .in-auth__brand { padding: 60px 60px; }
}

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

@media (prefers-color-scheme: dark) {
  .in-auth {
    background: #0b1220;
    color: #e5e7eb;
  }
  .in-auth__main { color: #e5e7eb; }
  .in-auth__card {
    background: #111827;
    border-color: #1f2937;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
  }
  .in-auth__card-head p { color: #9ca3af; }
  .in-input input {
    background: #0f172a;
    border-color: #374151;
    color: #e5e7eb;
  }
  .in-input input::placeholder { color: #6b7280; }
  .in-auth__options .in-check,
  .in-auth__alt,
  .in-auth__topbar a { color: #9ca3af; }
  .in-auth__alt { border-top-color: #1f2937; }
  .in-auth__lang summary { border-color: #374151; color: #cbd5e1; }
  .in-auth__lang ul { background: #111827; border-color: #1f2937; }
  .in-auth__lang li > a { color: #e5e7eb; }
  .in-auth__lang li > a:hover { background: #1f2937; }
  .in-demo { background: #111827; border-color: #374151; }
}
