/* Kokoodi Support (support.kokoodi.com). The Kokoodi Ops look for clients:
   warm cream ground, white cards, Figtree headings, Noto Sans text, Kokoodi
   blue. No framework and no other scripts, so the page's
   Content-Security-Policy stays at 'self' (plus Google Fonts). */

:root {
    --bg: #faf7f2;
    --card: #ffffff;
    --ink: #1f2937;
    --ink-2: #4b5563;
    --muted: #6b6f76;
    --border: #ebe5da;
    --border-soft: #f3efe7;
    --tint: #f6f2ea;
    --accent: #156d99;
    --accent-hover: #105a80;
    --accent-soft: #e6f2f8;
    --accent-ring: rgba(21, 109, 153, 0.18);
    --brand-ink: #0f2a36;
    --brand-deep: #12506a;
    --good: #0f8a6a;
    --good-soft: #e6f5ef;
    --warn: #a5520f;
    --warn-soft: #fdf0e5;
    --critical: #c62f2f;
    --critical-soft: #fdf1f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(31, 41, 55, 0.04), 0 8px 24px -12px rgba(31, 41, 55, 0.10);
    --shadow-lift: 0 2px 4px rgba(31, 41, 55, 0.05), 0 16px 32px -16px rgba(31, 41, 55, 0.18);
    --font: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: 'Figtree', 'Noto Sans', system-ui, sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15.5px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ── Type ──────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; color: var(--ink); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.eyebrow-light { color: rgba(255, 255, 255, 0.66); }
.headline { font-size: clamp(26px, 4vw, 34px); line-height: 1.18; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 24px; max-width: 640px; }
.lead { color: var(--ink-2); margin: 0 0 20px; }
.fine { color: var(--muted); font-size: 13.5px; margin: 18px 0 0; }
.center { text-align: center; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 11px 18px; font-weight: 600; font-size: 15px; cursor: pointer;
    transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease), border-color 0.18s;
    text-decoration: none; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 16px -8px rgba(21, 109, 153, 0.7); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--tint); color: var(--ink); }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
.btn[aria-busy="true"]::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.btn-ghost[aria-busy="true"]::before { border-color: var(--border); border-top-color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ── Fields ────────────────────────────────────────────────────────────── */
.field { display: block; border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.label { display: block; font-weight: 600; font-size: 14.5px; margin: 0 0 6px; color: var(--ink); padding: 0; }
.optional { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.hint { display: block; color: var(--muted); font-size: 13.5px; margin: -2px 0 8px; }
input[type="text"], input[type="email"], textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; transition: border-color 0.18s, box-shadow 0.18s; min-height: 46px;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.field.has-err input, .field.has-err textarea { border-color: var(--critical); }
.err { display: block; color: var(--critical); font-size: 13.5px; margin-top: 6px; min-height: 0; }
.err:empty { display: none; }
.counter { display: block; text-align: right; color: var(--muted); font-size: 12px; margin-top: 4px; }
.summary { background: var(--critical-soft); border: 1px solid #f3cfcb; color: #8f2020; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 20px; font-weight: 500; }

/* Project choice */
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
    display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: #fff; cursor: pointer; transition: all 0.18s var(--ease); min-width: 150px;
}
.choice small { color: var(--muted); font-size: 12.5px; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Severity */
.sev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sev { position: relative; display: block; cursor: pointer; }
.sev input { position: absolute; opacity: 0; inset: 0; }
.sev-body { display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; transition: all 0.18s var(--ease); }
.sev:hover .sev-body { border-color: #d9d0c1; }
.sev input:checked + .sev-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.sev input:focus-visible + .sev-body { box-shadow: 0 0 0 4px var(--accent-ring); }
.sev-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sev-desc { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; line-height: 1.45; }
.sev-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.sev-low { background: #9aa3ad; }
.sev-normal { background: var(--accent); }
.sev-high { background: #e47c2a; }
.sev-urgent { background: var(--critical); box-shadow: 0 0 0 3px rgba(198, 47, 47, 0.15); }

/* Files */
.drop { display: block; position: relative; border: 1.5px dashed #d9d0c1; border-radius: var(--radius); background: var(--tint); cursor: pointer; transition: all 0.18s var(--ease); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px; text-align: center; color: var(--ink-2); pointer-events: none; }
.drop-inner svg { color: var(--accent); }
.drop-inner .hint { margin: 0; }
.files { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; }
.files img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-soft); }
.files .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fsize { color: var(--muted); font-size: 12.5px; }
.files button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.files button:hover { color: var(--critical); background: var(--critical-soft); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.actions.center { justify-content: center; }

/* ── Signed out ────────────────────────────────────────────────────────── */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(120% 90% at 0% 0%, #1a6d93 0%, transparent 55%), linear-gradient(155deg, var(--brand-deep) 0%, var(--brand-ink) 62%);
    display: flex; align-items: center; padding: 56px clamp(32px, 6vw, 88px);
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-mark { width: 40px; height: auto; margin-bottom: 36px; opacity: 0.95; }
.auth-headline { color: #fff; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 600; margin: 0 0 28px; letter-spacing: -0.02em; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.auth-points li { display: flex; gap: 12px; color: rgba(255, 255, 255, 0.84); line-height: 1.5; }
.auth-points .dot { flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: #7fd0ef; box-shadow: 0 0 0 4px rgba(127, 208, 239, 0.16); }
.auth-glow { position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(24, 152, 184, 0.35), transparent 65%); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lift); padding: 32px 30px 28px; animation: rise 0.45s var(--ease) both; }
.auth-card h1 { font-size: 24px; margin: 0 0 8px; font-weight: 600; }
.auth-logo { width: 120px; margin: 0 0 26px; }
.auth-foot { color: var(--muted); font-size: 12.5px; margin-top: 22px; }
.badge-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; font: 700 22px var(--display); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* ── Signed in ─────────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px clamp(16px, 4vw, 40px); background: rgba(250, 247, 242, 0.88); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 96px; }
.brand-tag { font: 600 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-email { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.page { max-width: 920px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 32px) 64px; outline: none; }
.page > section { animation: rise 0.35s var(--ease) both; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 32px; }
.page-status { color: var(--muted); font-size: 14px; text-align: center; }
.page-status:empty { display: none; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.hero .sub { margin-bottom: 0; }
.filters { display: flex; gap: 8px; margin: 0 0 16px; }
.chip-tab { border: 1px solid var(--border); background: var(--card); color: var(--ink-2); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.chip-tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form { padding: 26px clamp(18px, 3vw, 30px) 24px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--ink-2); font-weight: 500; cursor: pointer; padding: 6px 8px 6px 2px; margin: 0 0 14px; border-radius: 8px; }
.back:hover { color: var(--accent); }

/* Request list */
.list { display: grid; gap: 10px; }
.req {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
    text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
    cursor: pointer; text-align: left; width: 100%; font: inherit;
}
.req:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: #ddd4c4; }
.req-title { font: 600 16px/1.35 var(--display); margin: 0; overflow-wrap: anywhere; }
.req-meta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; grid-column: 1 / -1; }
.req-meta .ref { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-new { background: var(--accent-soft); color: var(--accent); }
.pill-open { background: #eef0ff; color: #4048b0; }
.pill-waiting { background: var(--warn-soft); color: var(--warn); }
.pill-resolved { background: var(--good-soft); color: var(--good); }
.pill-closed { background: var(--tint); color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; border: 1.5px dashed var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, 0.5); }
.empty-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty h2 { font-size: 19px; margin: 0 0 6px; font-weight: 600; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }

.sk { display: block; height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, #f1ece3 0%, #f8f5ef 50%, #f1ece3 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* Done */
.done { padding: 38px clamp(20px, 4vw, 44px); text-align: center; }
.done .headline { max-width: 560px; margin: 0 auto 24px; }
.tick { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); animation: pop 0.5s var(--ease) both; }
.steps { list-style: none; padding: 0; margin: 0 auto 26px; max-width: 520px; text-align: left; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; color: var(--ink-2); }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 13px var(--display); }
.steps strong { color: var(--ink); }

/* One request */
.t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.t-head h1 { font-size: clamp(22px, 3.4vw, 28px); line-height: 1.25; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.t-meta { color: var(--muted); font-size: 14px; margin: 0 0 22px; display: flex; gap: 4px 14px; flex-wrap: wrap; }
.t-state { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin: 0 0 22px; background: var(--card); border: 1px solid var(--border); }
.t-state .st-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.t-state.good .st-ico { background: var(--good-soft); color: var(--good); }
.t-state.warn .st-ico { background: var(--warn-soft); color: var(--warn); }
.t-state p { margin: 2px 0 0; color: var(--ink-2); font-size: 14.5px; }
.t-state strong { font-family: var(--display); }

.thread { display: grid; gap: 14px; margin: 0 0 22px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--display); color: #fff; background: #8b93a0; }
.msg.us .avatar { background: linear-gradient(160deg, #1a84b8, var(--accent)); }
.bubble { background: var(--card); border: 1px solid var(--border); border-radius: 4px var(--radius) var(--radius) var(--radius); padding: 12px 16px; box-shadow: var(--shadow); min-width: 0; }
.msg.us .bubble { background: #f4f9fc; border-color: #d6e8f2; }
.bubble-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; font-size: 13.5px; }
.bubble-head strong { font-family: var(--display); font-size: 14.5px; }
.bubble-head time { color: var(--muted); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px 48px; }
.attach span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); background: var(--card); border: 1px solid var(--border); padding: 5px 10px; border-radius: 999px; }

.composer { padding: 18px; }
.composer textarea { min-height: 110px; }
.composer .actions { justify-content: space-between; }
.composer .attach-btn { position: relative; overflow: hidden; }
.composer .attach-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.closed-note { color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* Boot, spinner, toast */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 20; transition: opacity 0.25s; }
.boot.gone { opacity: 0; pointer-events: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 8px auto 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lift); font-size: 14.5px; z-index: 30; max-width: calc(100vw - 32px); animation: rise 0.3s var(--ease) both; }
.toast.bad { background: #8f2020; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Phones ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 36px 24px 30px; min-height: 0; }
    .auth-mark { margin-bottom: 18px; width: 30px; }
    .auth-headline { font-size: 28px; margin-bottom: 16px; }
    .auth-points { display: none; }
    .auth-main { justify-content: flex-start; padding: 0 16px 32px; margin-top: -18px; }
    .auth-card { padding: 26px 20px 22px; }
}
@media (max-width: 560px) {
    .sev-grid { grid-template-columns: 1fr; }
    .who-email { display: none; }
    .hero .btn { width: 100%; }
    .req { grid-template-columns: minmax(0, 1fr); }
    .attach { margin-left: 0; }
    .page { padding-top: 24px; }
}
.field-tight { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
