/* Iris customer portal — shared design system.
   Teal (#2f6f5e) / ochre (#a8763e) / warm paper (#f5f3ee), serif display.
   Loaded by every page; page-specific rules stay inline in that page. */

:root {
  --bg: #f5f3ee;
  --bg-raised: #fbfaf6;
  --bg-panel: #ffffff;
  --ink: #1c2321;
  --ink-soft: #3a423e;
  --muted: #6b7268;
  --line: #dcd7c9;
  --accent: #2f6f5e;
  --accent-soft: #e3ede9;
  --iris: #2f6f5e;
  --iris-soft: #e3ede9;
  --good: #a8763e;
  --good-soft: #f3e9dc;
  --shadow: 0 1px 3px rgba(28, 35, 33, 0.08);

  /* Type scale — one ladder for the whole site, so headings and body text
     stop drifting into ad-hoc sizes. Rem-based; 1rem = 16px. */
  --fs-display: clamp(2rem, 4.4vw, 3rem); /* hero / page headline (matches .page-head h1) */
  --fs-h2: 2rem;        /* section headings */
  --fs-h3: 1.3rem;      /* card / subsection headings */
  --fs-lead: 1.12rem;   /* lead paragraph under a heading (matches .page-head .dek) */
  --fs-body: 1rem;      /* default body */
  --fs-sm: 0.9rem;      /* small body, card copy, links */
  --fs-xs: 0.8rem;      /* labels, meta, captions */
  --fs-2xs: 0.7rem;     /* eyebrows, tags, ribbons */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
a { color: var(--accent); }

/* ---------- Focus states ----------
   One consistent keyboard-focus ring for every interactive surface. Uses
   :focus-visible so it shows for keyboard/AT users without ringing on click. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.option-card:focus-visible,
.chip:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 4px; }

section { padding: 88px 24px; }
.wrap { max-width: 980px; margin: 0 auto; }
.wrap-narrow { max-width: 720px; margin: 0 auto; }
.eyebrow {
  font-size: 12.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 12px;
}

/* ---------- Nav ---------- */
nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 980px; margin: 0 auto; padding: 14px 24px;
  position: relative; z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.25rem; letter-spacing: 0.01em; color: var(--accent); font-weight: 700; text-decoration: none;
}
.brand .mark { width: 26px; height: 26px; display: block; object-fit: contain; }
/* Brand name "Iris" set inline in body copy, matching the logo wordmark. */
.wordmark { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 700; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-menu { position: relative; }
.nav-menu summary {
  display: flex; align-items: center; gap: 6px; color: var(--ink-soft);
  font-size: 14.5px; cursor: pointer; list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: "▾"; font-size: 10px; transition: transform 0.15s ease; }
.nav-menu[open] summary::after { transform: rotate(180deg); }
.nav-menu summary:hover,
.nav-menu summary.active,
.nav-menu[open] summary { color: var(--accent); }
.nav-menu summary.active { font-weight: 600; }
.nav-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.nav-dropdown {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: -14px; width: 188px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-raised); box-shadow: 0 14px 30px rgba(42, 38, 34, 0.14);
}
.nav-dropdown a { display: block; padding: 9px 10px; border-radius: 6px; white-space: nowrap; }
.nav-dropdown a:hover { background: var(--accent-soft); }
.nav-account { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.nav-account.is-loading { width: 54px; }
.nav-account-signed-in { display: flex; align-items: center; gap: 10px; }
.nav-account .nav-sign-in,
.nav-account .nav-sign-out { color: var(--ink); font-weight: 600; }
.nav-account .nav-profile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; color: var(--accent); border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-raised);
}
.nav-account .nav-profile:hover { color: var(--accent); border-color: var(--accent); }
.nav-account .nav-profile svg { width: 18px; height: 18px; }
.nav-links .cta-small {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 10px; background: var(--accent);
  color: #fff; font-weight: 700;
}
.nav-links .cta-small:hover { color: #fff; background: #285f51; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 8px;
  font-size: 15px; font-weight: 600; text-decoration: none; transition: transform 0.15s ease;
  cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fbfaf6; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Page header (interior pages) ---------- */
.page-head { text-align: center; padding: 56px 24px 8px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); max-width: 20ch; margin: 0 auto 16px; }
.page-head h1 em { color: var(--accent); font-style: normal; }
.page-head .dek { max-width: 54ch; margin: 0 auto; font-size: 1.12rem; color: var(--ink-soft); }

/* ---------- Prose ---------- */
.prose h2 { font-size: 1.55rem; margin: 0 0 12px; }
.prose h3 { font-size: 1.2rem; margin: 0 0 8px; }
.prose p { color: var(--ink-soft); margin: 0 0 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 26px 24px;
}
.tag {
  align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
}
.tag.free { background: var(--iris-soft); color: var(--iris); }
.tag.time { background: var(--good-soft); color: var(--good); }
.tag.talk { background: #eef0ec; color: var(--ink-soft); }

/* ---------- Slack mock ---------- */
.slack-mock {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(28, 35, 33, 0.09);
}
.slack-mock .channel-bar {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft);
}
.slack-mock .channel-bar strong { color: var(--ink); }
.slack-mock .msgs { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.avatar.iris { background: var(--iris-soft); color: var(--iris); }
.avatar.human { background: var(--good-soft); color: var(--good); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { font-size: 13.5px; margin-bottom: 3px; }
.msg-head .name { font-weight: 700; color: var(--ink); }
.msg-head .ts { color: var(--muted); margin-left: 7px; font-size: 12.5px; }
.msg-text { font-size: 14.5px; color: var(--ink-soft); }
.msg-card {
  margin-top: 10px; background: var(--bg-raised);
  border: 1px solid var(--line); border-left: 3px solid var(--iris);
  border-radius: 0 8px 8px 0; padding: 12px 16px; font-size: 13.5px; color: var(--ink-soft);
}
.msg-card .field { margin-bottom: 4px; }
.msg-card .field b { color: var(--ink); }
.reaction {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: var(--good-soft); border: 1px solid var(--good); color: var(--good);
  border-radius: 6px; padding: 3px 10px; font-size: 13px; font-weight: 600;
}
.status-line {
  font-size: 13px; color: var(--good); margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* ---------- Screenshot placeholder (D4 pending) ---------- */
.shot {
  background: repeating-linear-gradient(45deg, var(--bg-raised), var(--bg-raised) 14px, #f1eee5 14px, #f1eee5 28px);
  border: 1px dashed var(--line); border-radius: 12px;
  min-height: 220px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 28px; gap: 8px;
}
.shot .shot-badge {
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--good); font-weight: 700;
}
.shot .shot-cap { color: var(--ink-soft); font-size: 14.5px; max-width: 40ch; }
.shot .shot-note { color: var(--muted); font-size: 12.5px; }

/* ---------- Coming-soon stub ---------- */
.stub {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  padding: 40px 36px; text-align: center;
}
.stub .stub-badge {
  display: inline-block; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--good); font-weight: 700; background: var(--good-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.stub h2 { font-size: 1.6rem; margin: 0 auto 12px; max-width: 22ch; }
.stub p { color: var(--ink-soft); max-width: 50ch; margin: 0 auto 12px; }
.stub .stub-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
[data-prefilled-locked="true"] { background: var(--bg); color: var(--ink-soft); cursor: default; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.req { color: #b23b3b; font-weight: 700; }
.field input[type=text], .field input[type=email], .field input[type=url], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-panel); color: var(--ink); font: inherit; font-size: 14.5px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px;
  color: var(--ink-soft); cursor: pointer; user-select: none; background: var(--bg-panel);
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.consent {
  display: flex; gap: 12px; align-items: flex-start; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-top: 4px;
}
.consent input { margin-top: 4px; flex: none; }
.consent .consent-text { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 36px 24px; text-align: center;
  color: var(--muted); font-size: 13px;
}
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  nav { padding-inline: 16px; }
  .nav-links { gap: 10px; }
  .nav-links a:not(.cta-small) { display: none; }
  .nav-account a:not(.auth-hidden) { display: inline-flex !important; }
  .nav-account a.auth-hidden { display: none !important; }
  .nav-account { gap: 7px; }
  .nav-dropdown { right: 0; left: auto; }
  .nav-dropdown a { display: block !important; }
}

/* Auth visibility utility, toggled by assets/auth.js (Phase 2c). */
.auth-hidden { display: none !important; }
