/*
 * iCare intro / sign-in screen.
 *
 * Adapted from iScale (https://github.com/zenmastercat/iScale), static/styles.css,
 * the "login" section (.login-wrap, .login-pitch, .pitch-strip, .pitch-list, .login-card,
 * .login-tabs, .acct-kind/.acct-opt, .btn.big, login-in animation) and its design tokens.
 * Copyright the iScale authors. Licensed under the Apache License, Version 2.0;
 * full text: ../vendor/ISCALE-LICENSE.txt
 *
 * Changes made for iCare (Apache-2.0 §4b): colours replaced by the iCare palette, class names
 * prefixed "in-", iCare-specific additions (area select, certificate field, role cards for
 * Employer/Caretaker), removed iScale's company/join-code options, fonts self-hosted below.
 * Fonts: Inter and IBM Plex Sans Thai (SIL OFL 1.1, ../vendor/fonts/OFL-*.txt), files from iScale.
 */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(../vendor/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(../vendor/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(../vendor/fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 400; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-thai-thai-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 600; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-thai-thai-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 700; font-display: swap; src: url(../vendor/fonts/ibm-plex-sans-thai-thai-700-normal.woff2) format("woff2"); }

:root {
  /* iCare palette (see ../css/style.css): teal primary, healthcare blue, care green, alert coral */
  --in-paper: #F3F7F8;
  --in-surface: #ffffff;
  --in-ink: #10262E;
  --in-ink-2: #4A5C63;
  --in-rule: #DCE5E8;
  --in-rule-soft: #ECF2F3;
  --in-action: #0B7A6E;        /* AA-safe teal for text/buttons (user's choice) */
  --in-action-hover: #244B86;  /* Healthcare Blue */
  --in-action-tint: #E8F7F5;
  --in-teal: #17B8A6; --in-blue: #244B86; --in-green: #82C66A; --in-coral: #FF6575; --in-amber: #F2B705;
  --in-font: "Inter", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  --in-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--in-paper); color: var(--in-ink); font: 15px/1.5 var(--in-font); }

.in-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); animation: in-rise 380ms var(--in-ease-out) both; }
@keyframes in-rise { from { opacity: 0; transform: translateY(8px); } }

/* left: pitch */
.in-pitch { padding: clamp(28px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 760px; justify-self: end; width: 100%; }
.in-brand img { height: 40px; width: auto; display: block; }
.in-pitch h1 { margin: 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.28; letter-spacing: -0.01em; font-weight: 700; text-wrap: balance; color: var(--in-ink); }
.in-lede { margin: 0; font-size: 17px; color: var(--in-ink-2); max-width: 46ch; text-wrap: pretty; }
.in-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; max-width: 420px; height: 8px; }
.in-strip i { background: var(--c); border-radius: 2px; transform-origin: left; animation: in-grow 600ms var(--in-ease-out) both; animation-delay: calc(var(--n) * 50ms + 120ms); }
@keyframes in-grow { from { transform: scaleX(0); opacity: 0; } }
.in-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; max-width: 680px; }
.in-list li { display: grid; gap: 3px; align-content: start; padding-top: 12px; border-top: 1px solid var(--in-rule); }
.in-list b { font-size: 15px; }
.in-list span { font-size: 13.5px; color: var(--in-ink-2); text-wrap: pretty; }
.in-links { font-size: 13.5px; color: var(--in-ink-2); }
.in-links a { color: var(--in-action); }

/* right: card */
.in-card { width: min(420px, 100%); background: var(--in-surface); border: 1px solid var(--in-rule); border-radius: 10px; display: grid; gap: 12px;
  align-self: center; justify-self: start; margin: 32px clamp(24px, 5vw, 72px) 32px 0; padding: 30px 30px 22px;
  box-shadow: 0 1px 2px rgba(16, 38, 46, 0.05), 0 18px 44px -26px rgba(16, 38, 46, 0.35); }
.in-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--in-paper); border: 1px solid var(--in-rule); border-radius: 8px; }
.in-tabs button { border: 0; background: none; border-radius: 6px; min-height: 44px; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--in-ink-2); cursor: pointer; touch-action: manipulation; transition: background-color 120ms ease, color 120ms ease; }
.in-tabs button[aria-selected="true"] { background: var(--in-surface); color: var(--in-ink); box-shadow: 0 1px 2px rgba(16, 38, 46, 0.12); }
.in-form { display: grid; gap: 12px; }
.in-form > * { animation: in-fade 220ms var(--in-ease-out) both; }
@keyframes in-fade { from { opacity: 0; transform: translateY(4px); } }
.in-roles { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.in-roles legend { font-size: 13px; color: var(--in-ink-2); margin-bottom: 6px; padding: 0; }
.in-role { position: relative; display: block; cursor: pointer; }
.in-role input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.in-role span { display: grid; gap: 3px; height: 100%; padding: 12px; border: 1px solid var(--in-rule); border-radius: 8px; background: var(--in-surface); transition: border-color 120ms ease, background-color 120ms ease; }
.in-role b { font-size: 14.5px; }
.in-role small { font-size: 12.5px; color: var(--in-ink-2); line-height: 1.35; }
.in-role input:checked + span { border-color: var(--in-action); background: var(--in-action-tint); box-shadow: inset 0 0 0 1px var(--in-action); }
.in-role input:focus-visible + span { outline: 2px solid var(--in-teal); outline-offset: 2px; }
.in-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--in-ink-2); }
.in-field small { font-size: 12px; }
.in-input { min-height: 44px; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--in-rule); background: var(--in-surface); font: inherit; font-size: 16px; color: var(--in-ink); min-width: 0; }
.in-input[type=file] { height: auto; padding: 10px 12px; font-size: 14px; }
.in-input:focus { outline: none; border-color: var(--in-action); box-shadow: 0 0 0 3px var(--in-action-tint); }
.in-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 5px; border: 1px solid var(--in-action);
  background: var(--in-action); color: #fff; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: transform 120ms var(--in-ease-out), background-color 120ms ease, border-color 120ms ease; }
.in-btn:active:not(:disabled) { transform: scale(0.97); }
.in-btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .in-btn:hover:not(:disabled) { background: var(--in-action-hover); border-color: var(--in-action-hover); } }
.in-help { margin: 0; border-top: 1px solid var(--in-rule-soft); padding-top: 12px; font-size: 13px; color: var(--in-ink-2); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; } /* honeypot field */
.in-error { margin: 0; color: #B3261E; font-size: 14px; min-height: 1.2em; }
:focus-visible { outline: 2px solid var(--in-teal); outline-offset: 2px; }

@media (max-width: 900px) {
  .in-wrap { grid-template-columns: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom, 16px); }
  .in-card { order: -1; justify-self: stretch; margin: 16px 16px 8px; width: auto; padding: 22px 18px 18px; border-radius: 18px; }
  .in-pitch { justify-self: stretch; padding: 16px 20px 28px; gap: 14px; }
  .in-list { grid-template-columns: 1fr; gap: 12px; }
  .in-lede { font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .in-wrap { animation-name: in-fade-only; } .in-strip i, .in-form > * { animation: none; }
  @keyframes in-fade-only { from { opacity: 0; } }
  .in-btn:active:not(:disabled) { transform: none; }
}
