/* MyClaimsIQ - shared tokens and controls (login + admin) */
:root {
  --navy-900: #0F2236;
  --navy-800: #142A42;
  --navy-700: #1F3A57;
  --navy-600: #2B4A6B;
  --navy-100: #E6ECF3;
  --navy-50:  #F3F6FA;
  --ink:      #1E2F45;
  --ink-2:    #4A5B6E;
  --ink-3:    #6E7D8E;
  --line:     #D8DEE5;
  --line-2:   #E7EBF0;
  --surface:  #F5F7FA;
  --white:    #FFFFFF;
  --rose:     #B04A5A;
  --rose-bg:  #FBEFF1;
  --green:    #2E7D5B;
  --green-bg: #EAF5EF;
  --amber:    #8A6200;
  --amber-bg: #FDF5E1;
  --focus:    0 0 0 3px rgba(43, 74, 107, .28);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 4px;
  --radius:    6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
a { color: var(--navy-600); text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }
h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--ink); }
p { margin: 0; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- form controls ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .field-label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12.5px; color: var(--rose); }
.input, .select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A5B6E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder { color: #9AA6B4; }
.input:hover, .select:hover { border-color: #B9C3CF; }
.input:focus, .select:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--rose); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(176, 74, 90, .2); }
.input:disabled, .select:disabled { background: var(--surface); color: var(--ink-3); cursor: not-allowed; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 64px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--navy-600); font: 600 12.5px var(--font); cursor: pointer;
}
.password-toggle:hover { background: var(--navy-50); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus); }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-700); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: #C3CCD6; position: relative; transition: background .15s ease; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: transform .15s ease; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch input:disabled + .track { opacity: .55; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font: 600 14px var(--font); text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--navy-700); color: var(--white); }
.btn-primary:hover { background: var(--navy-800); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: #B9C3CF; background: var(--navy-50); color: var(--ink); }
.btn-danger { background: var(--rose); color: var(--white); }
.btn-danger:hover { background: #973D4C; color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy-600); }
.btn-ghost:hover { background: var(--navy-50); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { cursor: progress; opacity: .85; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; margin-bottom: 18px; }
.alert-error   { background: var(--rose-bg);  border-color: #EBC5CC; color: #7E2F3C; }
.alert-success { background: var(--green-bg); border-color: #BFDCCB; color: #1F5A40; }
.alert-info    { background: var(--navy-50);  border-color: #CBD6E2; color: var(--navy-700); }
.alert-warning { background: var(--amber-bg); border-color: #EBD69C; color: var(--amber); }
.alert .alert-close { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; opacity: .7; }
.alert .alert-close:hover { opacity: 1; }

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