/* MyPhone — ink, ivory and brass. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-display: swap; src: url("fonts/cormorant-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 600; font-display: swap; src: url("fonts/cormorant-600.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url("fonts/cormorant-500-italic.woff2") format("woff2"); }

:root {
  --bg: #f6f3ec;
  --bg-2: #efeae0;
  --surface: #fffdf9;
  --ink: #14213a;
  --ink-2: #3c4760;
  --muted: #6f7486;
  --line: #e3ddd0;
  --line-2: #d6cebd;
  --gold: #a8844a;
  --gold-soft: #f1e7d3;
  --gold-ink: #6e5527;
  --red: #a33a32;
  --red-soft: #f7e3df;
  --green: #2f6b4f;
  --green-soft: #e1efe6;
  --mark: var(--ink);
  --mark-ink: #c9a96a;
  --shadow: 0 1px 2px rgba(20, 33, 58, .05), 0 8px 24px -12px rgba(20, 33, 58, .18);
  --radius: 14px;
  --serif: "Cormorant", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1424;
    --bg-2: #111a2d;
    --surface: #141e33;
    --ink: #ece6d8;
    --ink-2: #c4c0b4;
    --muted: #8d93a3;
    --line: #233049;
    --line-2: #2f3d59;
    --gold: #c9a96a;
    --gold-soft: #2b2a24;
    --gold-ink: #e3cc9b;
    --red: #e08a80;
    --red-soft: #3a1f22;
    --green: #8cc7a6;
    --green-soft: #17302a;
    --mark: #c9a96a;
    --mark-ink: #0d1424;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--sans); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-ink); }
code, .mono { font-family: var(--mono); font-size: .86em; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 600; }
.right { text-align: right; }
.break { word-break: break-all; }
.fine { margin: 0; font-size: .8rem; color: var(--muted); }
.eyebrow {
  margin: 0 0 6px; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: var(--gold);
}
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(2.1rem, 4vw, 2.9rem); line-height: 1.05; letter-spacing: -.015em; }
.lede { margin: 12px 0 0; font-size: 1.05rem; color: var(--ink-2); max-width: 58ch; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; }
.wordmark:hover { color: inherit; }
.mark { width: 28px; height: 28px; color: var(--mark); flex: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.account-menu { display: flex; align-items: center; gap: 10px; }
.avatar-link { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 10px 4px 4px; border-radius: 999px; }
.avatar-link:hover, .avatar-link.active { background: var(--bg-2); color: inherit; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.avatar-sm { width: 34px; height: 34px; flex: none; }
.who { font-size: .88rem; font-weight: 500; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; flex: 1; display: flex; flex-direction: column; gap: 24px; }
.page.narrow { max-width: 560px; }
.center-page { justify-content: center; }
.page-head { margin-bottom: 4px; }
.page-head .muted { margin: 10px 0 0; }
.row-between { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.row-gap { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.footer { display: flex; justify-content: center; gap: 10px; padding: 28px 16px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); flex-wrap: wrap; }
.footer .dot { color: var(--gold); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow: visible; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 16px; }
.card-head .muted { margin: 4px 0 0; font-size: .88rem; }
.card-head.padded { padding: 22px 24px 0; margin-bottom: 8px; }
.empty { padding: 48px 24px; text-align: center; }
.empty h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; margin-bottom: 6px; }

.hero-card {
  position: relative; overflow: hidden; display: flex; gap: 40px; align-items: center; justify-content: space-between;
  padding: 44px 48px; border-radius: 20px; color: #ece6d8;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 169, 106, .22) 0%, transparent 46%),
    linear-gradient(160deg, #18264a 0%, #0f1830 60%, #0b1224 100%);
  box-shadow: 0 24px 60px -30px rgba(11, 18, 36, .7);
  border: 1px solid rgba(201, 169, 106, .18);
}
.hero-card .eyebrow { color: #c9a96a; }
.hero-card .lede { color: #c4c0b4; }
.hero-card .display { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.hero-card a:not(.btn) { color: #e3cc9b; }
.facts { display: flex; gap: 36px; margin: 28px 0 0; padding: 0; }
.facts div { border-left: 1px solid rgba(201, 169, 106, .35); padding-left: 14px; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: #8d93a3; }
.facts dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; align-items: center; }
.hero-card .btn-quiet { color: #c4c0b4; border-color: rgba(236, 230, 216, .18); }
.hero-card .btn-quiet:hover { background: rgba(236, 230, 216, .08); color: #fff; }
.hero-card .btn-primary { background: #c9a96a; color: #0f1830; border-color: #c9a96a; }
.hero-card .btn-primary:hover { background: #d8bb80; }
.qr { margin: 0; text-align: center; flex: none; }
.qr-frame { width: 176px; height: 176px; padding: 16px; border-radius: 16px; background: #f6f3ec; color: #14213a; display: grid; place-items: center; }
.qr-frame svg { width: 100%; height: 100%; }
.qr figcaption { margin-top: 12px; font-size: .82rem; line-height: 1.4; }
.qr .muted { color: #8d93a3; }

.step { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step-no { display: inline-block; font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--gold); line-height: 1; margin-bottom: 12px; }
.step h3 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: .92rem; }

.copy-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.copy-value { flex: 1; overflow-x: auto; white-space: nowrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 26px; border-left: 1px solid var(--line-2); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.timeline-meta { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.version { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.notes { margin-top: 4px; white-space: pre-line; color: var(--ink-2); font-size: .92rem; }
.link-sm { display: inline-block; margin-top: 6px; font-size: .82rem; color: var(--gold-ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: 500 .9rem/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--gold)); color: var(--bg); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-quiet:hover { background: var(--bg-2); color: var(--ink); }
.btn-quiet.is-done { color: var(--green); border-color: var(--green); }
.btn-danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .82rem; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; height: 46px; }
.btn code { font-size: .8rem; opacity: .85; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .8rem; font-weight: 500; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; }
input:not([type="checkbox"]):not([type="file"]), textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: 400 .95rem/1.4 var(--sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type="checkbox"]):not([type="file"]):focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
textarea { resize: vertical; min-height: 84px; }
.check { display: flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--bg); cursor: pointer; text-align: center; transition: border-color .15s ease, background-color .15s ease; }
.dropzone:hover, .dropzone.has-file { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; word-break: break-all; }

/* ── Tables & lists ──────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 16px 20px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.table .is-muted td { opacity: .6; }
.person { display: flex; align-items: center; gap: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; background: var(--bg-2); color: var(--ink-2); margin-right: 4px; }
.badge-gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-outline { background: transparent; border: 1px solid var(--line-2); }

.popover { position: relative; display: inline-block; text-align: left; }
.popover summary { list-style: none; }
.popover summary::-webkit-details-marker { display: none; }
.popover[open] summary { background: var(--bg-2); color: var(--ink); }
.popover-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 280px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(20, 33, 58, .4); }
.popover-body.wide { width: 360px; }

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: .9rem; background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); transition: opacity .4s ease; }
.flash-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.flash-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.flash.is-leaving { opacity: 0; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-split { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 48px 56px; color: #ece6d8;
  background: radial-gradient(90% 70% at 85% 10%, rgba(201, 169, 106, .2) 0%, transparent 60%), linear-gradient(165deg, #18264a 0%, #0d1528 70%);
}
.hero-brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.login-hero .mark { color: #c9a96a; --mark-ink: #0f1830; width: 34px; height: 34px; }
.hero-copy h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(3rem, 6vw, 5rem); line-height: .98; letter-spacing: -.02em; }
.hero-copy em { color: #c9a96a; }
.hero-copy .eyebrow { color: #c9a96a; margin-bottom: 20px; }
.hero-copy .lede { color: #b9b6ad; font-size: 1.1rem; margin-top: 22px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: .92rem; color: #c4c0b4; position: relative; z-index: 1; }
.hero-points span { display: inline-block; width: 34px; font-family: var(--serif); font-style: italic; color: #c9a96a; font-size: 1.05rem; }
.hero-glow { position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(201, 169, 106, .18); box-shadow: 0 0 0 60px rgba(201, 169, 106, .04), 0 0 0 120px rgba(201, 169, 106, .03); pointer-events: none; }
.login-panel { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font-family: var(--serif); font-weight: 500; font-size: 2.3rem; line-height: 1.05; }
.login-card > .muted { margin: -10px 0 6px; }
.error-card { text-align: left; display: flex; flex-direction: column; gap: 14px; align-items: start; padding: 40px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .grid-side, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero-card { flex-direction: column; align-items: stretch; padding: 32px 28px; }
  .qr { display: none; }
  .login-split { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 24px; gap: 28px; }
  .hero-points, .hero-glow { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; gap: 12px; height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .account-menu { margin-left: auto; }
  .who { display: none; }
  .page { padding: 24px 16px 48px; }
  .facts { gap: 20px; flex-wrap: wrap; }
  .hide-sm { display: none; }
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
  .popover-body, .popover-body.wide { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
}
.nowrap { white-space: nowrap; }
