/* DenBe Client Portal. Tokens follow the DenBe brand design system:
   globe blue #1d64bf, tagline gray #838589, panels #e6eff4 / #cadee9. Light theme only. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-700.woff2") format("woff2"); }

:root {
  --blue: #1d64bf;
  --blue-strong: #164e96;
  --blue-tint: #e6eff4;
  --blue-line: #cadee9;
  --ink: #16191f;
  --ink-muted: #4d5563;     /* 7.3:1 on white */
  --gray-brand: #838589;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --line: #d9e1ea;
  --ok: #1f7a46;
  --ok-tint: #e8f4ed;
  --warn: #9a4d0d;          /* 6.4:1 on white */
  --warn-tint: #fdf1e6;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --focus: 0 0 0 3px rgba(29, 100, 191, .35);
  font-family: "Inter", Calibri, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5; font-size: 16px; }
a { color: var(--blue); }
a:hover { color: var(--blue-strong); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }
code { font-size: .9em; background: var(--blue-tint); padding: 1px 5px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; color: var(--blue); font-size: 1.15rem; letter-spacing: .01em; }
.brand-sub { font-size: .8rem; color: var(--gray-brand); }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav-link { padding: .45rem .8rem; border-radius: 6px; text-decoration: none; color: var(--ink-muted); font-weight: 500; }
.nav-link:hover { background: var(--blue-tint); color: var(--ink); }
.nav-link.is-active { background: var(--blue-tint); color: var(--blue-strong); }
.who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.who-name { font-weight: 600; }
.who-company { color: var(--ink-muted); }
.who-form { margin: 0; }

/* Layout */
.main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.page-head { margin-bottom: 1.25rem; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.eyebrow { margin: 0 0 .25rem; font-size: .85rem; color: var(--ink-muted); }
.muted { color: var(--ink-muted); margin-top: 0; }
.meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--ink-muted); font-size: .9rem; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-attention { border-left: 4px solid var(--warn); }
.card-ok { border-left: 4px solid var(--ok); }
.card-danger { border-left: 4px solid var(--danger); }
.form-card { max-width: 720px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
a.tile:hover { border-color: var(--blue-line); background: #fbfdff; }
.tile-action { background: var(--blue); border-color: var(--blue); color: #fff; }
a.tile-action:hover { background: var(--blue-strong); color: #fff; }
.tile-title { font-weight: 600; font-size: 1.05rem; }
.tile-number { font-weight: 700; font-size: 2rem; line-height: 1; color: var(--blue); }
.tile-text { font-size: .92rem; }
.tile-action .tile-text { color: #eaf2fc; }
.tile-soon { opacity: .9; }
.badge { align-self: flex-start; margin-top: .4rem; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-strong); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: 600; padding: .5rem .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-compact td { padding: .4rem .5rem; font-size: .85rem; }
.row-title { font-weight: 600; text-decoration: none; display: block; }
.row-title:hover { text-decoration: underline; }
.row-sub { display: block; font-size: .82rem; color: var(--ink-muted); }
.is-closed .row-title { color: var(--ink-muted); }
.nowrap { white-space: nowrap; }

.status { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-strong); white-space: nowrap; }
.status-7 { background: var(--warn-tint); color: var(--warn); }
.status-13 { background: var(--warn-tint); color: var(--warn); }
.status-5, .status-20 { background: var(--ok-tint); color: var(--ok); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; background: var(--surface); }
.segmented a { padding: .45rem 1rem; text-decoration: none; color: var(--ink-muted); font-weight: 500; }
.segmented a.is-active { background: var(--blue); color: #fff; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: .5rem; }
label { font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="email"], textarea { font: inherit; padding: .6rem .7rem; border: 1px solid #b9c4d1; border-radius: 6px; background: #fff; width: 100%; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--focus); outline: none; }
.help { font-size: .85rem; color: var(--ink-muted); margin: 0 0 .5rem; }
.choice { border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; margin: .5rem 0; }
.choice legend { font-weight: 600; font-size: .92rem; padding: 0 .25rem; }
.choice label { display: block; font-weight: 400; padding: .2rem 0; }
.actions { display: flex; gap: 1rem; align-items: center; margin-top: .5rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); color: #fff; }
.btn-secondary { background: #fff; color: var(--blue-strong); border-color: var(--blue-line); }
.btn-secondary:hover { background: var(--blue-tint); }
.btn-provider { background: #fff; color: var(--ink); border-color: #b9c4d1; width: 100%; }
.btn-provider:hover { background: var(--bg); color: var(--ink); }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; }
button[aria-busy="true"] { opacity: .7; cursor: progress; }

.alert { padding: .75rem 1rem; border-radius: 6px; margin: .75rem 0; font-size: .95rem; }
.alert-error { background: var(--danger-tint); color: var(--danger); border: 1px solid #f3c1bc; }
.alert-ok { background: var(--ok-tint); color: var(--ok); border: 1px solid #bfe0cb; }

/* Sign-in */
.auth { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-buttons { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--ink-muted); font-size: .85rem; margin: 1.25rem 0 1rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.dev { margin-top: 1.5rem; font-size: .9rem; border-top: 1px dashed var(--line); padding-top: 1rem; }

/* Ticket detail */
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .75rem 0 .75rem 1rem; border-left: 2px solid var(--blue-line); margin-left: .25rem; }
.timeline-meta { margin: 0 0 .25rem; font-size: .85rem; color: var(--ink-muted); }
.timeline-title { margin: 0 0 .25rem; font-weight: 600; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.error-card { max-width: 560px; margin: 2rem auto; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 1rem; font-size: .88rem; color: var(--ink-muted); }
.footer-inner p { margin: .2rem 0; }
.footer-fine { font-size: .8rem; }

@media (max-width: 640px) {
  .who-company { display: none; }
  .nav { order: 3; flex-basis: 100%; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
