/* Page de connexion de la démo Assure CRM. Publique (servie sans session) : aucune donnée de la maquette ici.
   Tokens repris de apps/web/src/styles/global.css (CLAUDE.md §10). */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/auth/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/auth/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/auth/fonts/ibm-plex-sans-thai-thai-400-normal.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/auth/fonts/ibm-plex-sans-thai-thai-500-normal.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/auth/fonts/ibm-plex-sans-thai-thai-600-normal.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'IBM Plex Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/auth/fonts/ibm-plex-sans-thai-thai-700-normal.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  --brand: #00aed6;
  --brand-strong: #007c99;
  --brand-deep: #006a83;
  --brand-50: #eaf8fb;
  --brand-100: #d2f0f7;
  --brand-glow: rgb(0 174 214 / 22%);
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eff3f5;
  --border: #e4e9ec;
  --border-strong: #ccd4d9;
  --border-hover: #b3bdc4;
  --text: #17212b;
  --text-2: #3d4852;
  --muted: #5d6872;
  --on-brand: #ffffff;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --danger-line: #f5c2bc;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgb(16 32 44 / 5%);
  --shadow-card: 0 1px 2px rgb(16 32 44 / 4%), 0 12px 32px -8px rgb(16 32 44 / 14%), 0 0 0 1px rgb(16 32 44 / 5%);
  --ring: 0 0 0 3px var(--brand-glow);
  --font: 'Plus Jakarta Sans', 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --duration: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* Fond légèrement teinté, voile du cyan de la marque en haut. */
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--brand-50), transparent 70%),
    var(--bg);
}
:lang(th) body {
  line-height: 1.65;
}

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

.page {
  display: grid;
  place-items: center;
  /* Encoche et barres système en web app (viewport-fit=cover). */
  padding: max(32px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
}

.card {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 28px 28px;
  display: grid;
  gap: 24px;
  animation: rise 240ms var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Logo en <img> sur fond blanc, jamais inliné (CLAUDE.md §10). */
.logo {
  display: block;
  height: 34px;
  width: auto;
}

.lang {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}
.lang button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  height: 26px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}
.lang button:hover {
  color: var(--text);
}
.lang button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--brand-deep);
  box-shadow: var(--shadow-xs);
}

.heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}
.input:hover {
  border-color: var(--border-hover);
}
.input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.input[aria-invalid='true'] {
  border-color: var(--danger-line);
}

.password {
  position: relative;
}
.password .input {
  padding-right: 52px;
}
.toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}
.toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}
.toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 0;
}
.toggle svg {
  width: 18px;
  height: 18px;
}
.toggle .icon-hide,
.toggle[aria-pressed='true'] .icon-show {
  display: none;
}
.toggle[aria-pressed='true'] .icon-hide {
  display: block;
}

.error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.error svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.error[hidden] {
  display: none;
}

.submit {
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-strong);
  color: var(--on-brand);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}
.submit:hover {
  background: var(--brand-deep);
}
.submit:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.submit[aria-busy='true'] {
  opacity: 0.8;
  cursor: progress;
}

.demo {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 600;
}
.demo::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.footer {
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .card {
    padding: 24px 20px 20px;
    gap: 20px;
  }
  .logo {
    height: 28px;
  }
}
