/* Smilden - practice web app. Follows Apple's Human Interface Guidelines: system font and type scale, generous
   spacing, one accent color, 44 pt touch targets, clear focus, light and dark appearance, reduced motion. */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fbfbfd; --label: #1d1d1f; --secondary: #6e6e73;
  --tertiary: #86868b; --separator: rgba(0, 0, 0, .1); --fill: rgba(120, 120, 128, .12);
  --accent: #0066cc; --accent-pressed: #0055aa; --on-accent: #ffffff;   /* Apple link blue: >= 4.5:1 on the page grey */
  --btn: #0071e3; --btn-pressed: #0062c4;           /* white text >= 4.5:1 in both appearances */
  --accent-on-fill: #0058b0;                        /* blue text on grey fill >= 4.5:1 */
  --green: #248a3d; --green-text: #1a6e30; --orange: #b23000; --red: #d70015; --orange-bg: #fff4e5; --red-bg: #fff1f0;
  --toast-error: #c00012;
  --gold: #6e5000; --gold-bg: #fbf1d6;  /* Premium Member */
  --radius: 18px; --radius-s: 12px; --shadow: 0 2px 12px rgba(0, 0, 0, .06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.47; color: var(--label); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --label: #f5f5f7; --secondary: #a1a1a6;
    --tertiary: #8e8e93; --separator: rgba(255, 255, 255, .15); --fill: rgba(120, 120, 128, .24);
    --accent: #2997ff; --accent-pressed: #0a84ff; --on-accent: #ffffff;
    --btn: #0071e3; --btn-pressed: #0062c4; --accent-on-fill: #64b5ff;
    --green: #30d158; --green-text: #30d158; --orange: #ff9f0a; --red: #ff6961; --orange-bg: #2c2112; --red-bg: #2c1514;
    --toast-error: #c00012;
    --gold: #f2cd6b; --gold-bg: #2e2610;
    --shadow: none;
  }
  .segmented button[aria-checked="true"] { background: #636366; box-shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 50; }

/* navigation bar: translucent material */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 max(20px, env(safe-area-inset-left)); height: 52px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--separator); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--label); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 30px; width: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
/* "Premium Member" beside the logo (J 2026-10-15): a quiet gold capsule */
.member { padding: 3px 10px; border-radius: 999px; background: var(--gold-bg); color: var(--gold); font-size: 12px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; margin-top: -4px; }
.nav { display: flex; gap: 20px; font-size: 14px; }
.nav a { color: var(--label); opacity: .85; padding: 12px 0; }
.nav a[aria-current="page"] { opacity: 1; font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 32px 20px 120px; outline: none; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 8px; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 32px 0 12px; }
h3 { font-size: 17px; font-weight: 600; margin: 0; }
p { margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--secondary); margin-bottom: 28px; }
.secondary { color: var(--secondary); }
.footnote { font-size: 13px; color: var(--secondary); }

/* step indicator */
.steps { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.steps li { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); }
.steps li.done, .steps li.current { background: var(--accent); }
.step-label { font-size: 13px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: .04em; }

/* grouped content */
.group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px; }
.choices { display: grid; gap: 12px; }
.choices.cols-2 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%;
  min-height: 64px; padding: 16px 48px 16px 18px; border-radius: var(--radius-s); border: 1.5px solid var(--separator);
  background: var(--surface); color: var(--label); font: inherit; cursor: pointer; transition: border-color .15s; }
.choice:hover { border-color: var(--tertiary); }
.choice[aria-checked="true"], .choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.choice[aria-checked="true"]::after, .choice[aria-pressed="true"]::after { content: ""; position: absolute; right: 16px;
  top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--accent)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.choices.cols-2 .choice { padding-right: 34px; }
.choices.cols-2 .choice[aria-checked="true"]::after { top: 10px; right: 10px; margin-top: 0; width: 18px; height: 18px; background-size: 13px; }
.choice .title { font-weight: 600; }
.choice .sub { font-size: 14px; color: var(--secondary); }

/* segmented control */
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.segmented button { min-width: 96px; min-height: 44px; padding: 6px 16px; border: 0; border-radius: 7px; background: transparent;
  color: var(--label); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); font-weight: 600; }

/* forms */
.field { margin: 0 0 16px; }
.field > label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 6px; }
h2.inline { font-size: 17px; margin: 0 0 12px; }
.case-head h2.inline { margin: 0; }
.hint { display: block; font-size: 13px; color: var(--secondary); margin-top: 6px; }
.error { display: block; font-size: 13px; color: var(--red); margin-top: 6px; font-weight: 500; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--separator); background: var(--surface-2); color: var(--label); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[aria-invalid="true"] { border-color: var(--red); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.switch { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; }
.switch label { cursor: pointer; }
.switch input { appearance: none; flex: 0 0 51px; width: 51px; height: 31px; min-height: 31px; padding: 0; border: 0;
  border-radius: 16px; background: var(--fill); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 28px;
  border-radius: 12px; border: 0; background: var(--btn); color: var(--on-accent); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--btn-pressed); text-decoration: none; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.secondary { background: var(--fill); color: var(--accent-on-fill); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 8px; min-height: 44px; }
.btn.destructive { background: transparent; color: var(--red); padding: 0 8px; min-height: 44px; }
.actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 28px; }
.actions .btn:last-child { margin-left: auto; }
@media (max-width: 600px) {
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--separator); }
  .actions .btn:last-child { flex: 1; }
  h1 { font-size: 28px; }
  .nav { gap: 14px; }
}

/* uploads */
.slot { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--separator); }
.slot:last-child { border-bottom: 0; }
.slot .meta { flex: 1; min-width: 0; }
.slot .name { font-weight: 600; }
.slot .file { font-size: 14px; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop { border: 1.5px dashed var(--separator); border-radius: var(--radius-s); padding: 20px; text-align: center; color: var(--secondary); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
progress { width: 100%; height: 4px; appearance: none; border: 0; border-radius: 2px; background: var(--fill); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--fill); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.ok { color: var(--green-text); font-weight: 600; font-size: 14px; }

/* lists, status */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--separator); }
.list > li:last-child { border-bottom: 0; }
.case-card { display: block; color: var(--label); }
.case-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.case-card:hover { text-decoration: none; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--fill); color: var(--label); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.green { color: var(--green-text); }
.badge.red { background: var(--red-bg); color: var(--red); }
.progress-steps { display: flex; gap: 0; margin: 14px 0 4px; list-style: none; padding: 0; }
.progress-steps li { flex: 1; font-size: 13px; color: var(--secondary); padding-top: 10px; border-top: 3px solid var(--fill); }
.progress-steps li.done { color: var(--label); border-top-color: var(--accent); }
.details { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0 0 16px; }
.details dt { color: var(--secondary); }
.details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.progress-steps { margin-top: 18px; }
.callout { border-radius: var(--radius-s); padding: 14px 16px; margin: 12px 0; background: var(--orange-bg); color: var(--label); }
.callout.info { background: var(--fill); }
.callout strong { display: block; margin-bottom: 4px; }
.totals { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.totals td { padding: 8px 0; }
.totals td:last-child { text-align: right; }
.list .amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals tr.total td { border-top: 1px solid var(--separator); font-weight: 700; font-size: 19px; padding-top: 14px; }
.empty { text-align: center; padding: 48px 20px; color: var(--secondary); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; border-radius: 14px; background: rgba(28, 28, 30, .92); color: #fff; font-size: 15px; }
.toast.error { background: var(--toast-error); }
.noscript { padding: 40px 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* online preview: fake data only */
.preview-banner { position: relative; z-index: 6; padding: 10px 20px; text-align: center; font-size: 14px;
  background: #fff4e5; color: #6b3a00; border-bottom: 1px solid rgba(0, 0, 0, .08); }
@media (prefers-color-scheme: dark) { .preview-banner { background: #33260f; color: #ffd18a; } }

/* welcome for a signed-in member */
.welcome { margin: 0 0 20px; padding: 18px 22px; border-radius: var(--radius); background: var(--gold-bg); }
.welcome-title { margin: 0 0 4px; font-size: 19px; font-weight: 600; color: var(--label); }
.welcome .member-word { color: var(--gold); }
.welcome-sub { margin: 0; color: var(--label); }

/* the case form: four numbered parts on one screen */
main:has(.case-form) { max-width: 1160px; }
.case-form { display: grid; gap: 16px; }
.case-form .group { margin: 0; }
.step-title { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 20px; }
.step-title .num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--accent); color: var(--accent); font-size: 16px; font-weight: 700; }
.step.done .num { background: var(--accent); border-color: var(--accent); color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 18px; }
.step .footnote { margin-bottom: 14px; }
.choices.cols-3 { grid-template-columns: 1fr; }
.subrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.subrow h3.inline, h3.inline { margin: 0; font-size: 17px; }
h3.sub-head { margin: 18px 0 10px; }
@media (min-width: 1024px) {
  .case-form { grid-template-columns: 1fr 1fr; align-items: start; }
  .choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
/* wide screens: all four parts side by side, so the whole case fits on one screen */
@media (min-width: 1280px) {
  main:has(.case-form) { max-width: 1440px; padding-top: 20px; }
  main:has(.case-form) h1 { font-size: 28px; margin-bottom: 2px; }
  main:has(.case-form) .lead { font-size: 15px; margin-bottom: 14px; }
  .case-form { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .case-form .group { padding: 16px; }
  .step-title { font-size: 17px; }
  .choices.cols-3 { grid-template-columns: 1fr; gap: 8px; }
  .choices.cols-3 .choice { min-height: 0; padding: 10px 34px 10px 12px; }
  .choices.cols-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .choices.cols-2 .choice { min-height: 44px; padding: 10px 30px 10px 12px; }
  .choices:not(.cols-2):not(.cols-3) .choice { min-height: 0; padding: 12px 40px 12px 14px; }
  .segmented button { min-width: 0; padding: 6px 12px; }
  .case-form textarea { min-height: 64px; }
  .slot { padding: 10px 0; }
  .case-form .row { grid-template-columns: 1fr; }
  /* the action stays in view at the bottom of the window */
  .case-form + .actions { position: sticky; bottom: 0; z-index: 5; margin: 12px -20px 0; padding: 12px 20px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--separator); }
  .choices.cols-3 .choice { padding-right: 34px; }
  .choices.cols-3 .choice[aria-checked="true"]::after { top: 10px; right: 10px; margin-top: 0; width: 18px; height: 18px; background-size: 13px; }
}

/* phones: logo + Premium Member on the first row, the menu on its own row below */
@media (max-width: 600px) {
  .bar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; row-gap: 4px; }
  .nav { flex-basis: 100%; justify-content: space-between; gap: 8px; font-size: 15px; }
  .nav a { padding: 10px 0; white-space: nowrap; }
}
