/* TITAN AI — global design system. Deep-black premium theme, mobile-first. */
:root {
  --bg: #050507;
  --bg-soft: #0a0b11;
  --panel: #0e0f17;
  --panel-2: #14161f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6fb;
  --muted: #8b94a8;
  --muted-2: #5d6577;
  --accent: #2f81f7;
  --accent-2: #38e8ff;
  --accent-3: #8b5cf6;
  --grad: linear-gradient(135deg, #38e8ff 0%, #2f81f7 45%, #8b5cf6 100%);
  --grad-text: linear-gradient(120deg, #eaf6ff 0%, #8fd0ff 40%, #b39dff 100%);
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --nav-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 78% -10%, rgba(47, 129, 247, 0.16), transparent 60%),
    radial-gradient(50vw 50vw at 10% 8%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(40vw 40vw at 50% 110%, rgba(56, 232, 255, 0.10), transparent 60%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Icons (Lucide) ── */
[data-lucide],
svg.lucide { width: 20px; height: 20px; stroke: #fff; stroke-width: 1.75; vertical-align: middle; }
.muted [data-lucide], .muted svg.lucide { stroke: var(--muted); }

/* ── Navbar ── */
.tn-nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 1000;
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.tn-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .3px; }
.tn-brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(56, 232, 255, 0.45)); }
.tn-brand .name { font-size: 18px; font-weight: 800; color: #ffffff; }
.tn-beta {
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; padding: 3px 8px; border-radius: 999px;
  color: #cfe9ff; background: rgba(47, 129, 247, 0.16); border: 1px solid rgba(56, 232, 255, 0.35);
  text-transform: uppercase;
}
.tn-nav .spacer { flex: 1; }
.tn-nav .links { display: flex; align-items: center; gap: 6px; }
.tn-nav .links a { padding: 8px 12px; border-radius: 10px; color: #ffffff; font-size: 14px; font-weight: 600; }
.tn-nav .links a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
.tn-burger { display: inline-flex; background: none; border: 0; cursor: pointer; padding: 8px; }
@media (min-width: 860px) { .tn-burger { display: none; } }
@media (max-width: 859px) {
  .tn-nav .links {
    position: absolute; top: var(--nav-h); right: 12px; left: 12px; flex-direction: column;
    align-items: stretch; gap: 4px; padding: 10px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: none;
  }
  .tn-nav .links.open { display: flex; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; font-family: inherit; transition: transform .12s ease, filter .15s ease, background .15s ease;
  color: #fff; background: var(--panel-2); border-color: var(--border);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #1d4ed8; border: 0; color: #ffffff; font-weight: 800; box-shadow: 0 8px 24px rgba(29, 78, 216, 0.35); }
.btn-primary:hover { background: #2456e6; }
.btn-primary [data-lucide] { stroke: #ffffff; }
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Cards / layout ── */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.card {
  background: #17191f; /* dark gray surface, application-wide */
  border: 1px solid #3a3f4b; /* thin medium-gray border */
  border-radius: var(--radius); padding: 22px; color: #fff;
}
.card:hover { border-color: #565d6e; }
.card .muted, .card p.muted { color: #d7dce6; } /* keep card text white/near-white */
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 700; color: var(--accent-2); }
.h-grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; background: #07080d; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18); }
pre { background: #07080d; border: 1px solid var(--border); border-radius: 12px; padding: 14px; overflow: auto; font-size: 12px; }

/* Accessibility: a visible keyboard focus ring on every interactive element. */
a:focus-visible, button:focus-visible, .btn:focus-visible, [role="button"]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* Inline status notes (forms, checkout, workspace create) */
.ok { color: #7ee787; } .warn { color: #ffcc66; }

/* System-wide toast notifications */
#titan-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 92vw); }
.titan-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #11151f; border: 1px solid #2a3450; border-left: 3px solid #2f6feb; color: #e7edf7; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-size: 14px; line-height: 1.45; animation: tt-in .22s ease both; }
.titan-toast.success { border-left-color: #2ea043; }
.titan-toast.warn { border-left-color: #d29922; }
.titan-toast.error { border-left-color: #f85149; }
.titan-toast .tt-msg { flex: 1; }
.titan-toast .tt-x { background: none; border: 0; color: #8b949e; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.titan-toast .tt-x:hover { color: #fff; }
.titan-toast.hide { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes tt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Dashboard first-run onboarding */
.onboard { padding: 4px 2px; }
.onboard-title { font-weight: 800; color: var(--text); margin-bottom: 8px; font-size: 15px; }
.onboard-steps { margin: 0 0 10px; padding-left: 20px; color: var(--muted); line-height: 1.7; font-size: 13px; }
.onboard-steps li { margin: 2px 0; }

/* page padding under fixed nav */
.page { padding-top: calc(var(--nav-h) + 8px); min-height: 100vh; }

/* ── Cookie consent overlay (black, must accept) ── */
.cookie-overlay {
  position: fixed; inset: 0; z-index: 99999; display: none;
  align-items: center; justify-content: center; background: #000; padding: 22px;
}
.cookie-card {
  width: 100%; max-width: 540px; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 30px; text-align: center; box-shadow: var(--shadow);
}
.cookie-card .ico { width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(47, 129, 247, 0.14); border: 1px solid var(--border-strong); }
.cookie-card h3 { margin: 0 0 8px; font-size: 20px; }
.cookie-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.cookie-actions { display: flex; gap: 10px; flex-direction: column; }
@media (min-width: 520px) { .cookie-actions { flex-direction: row; justify-content: center; } }

.footer { border-top: 1px solid var(--border); margin-top: 80px; padding: 36px 0; color: #ffffff; font-size: 13px; }
.footer a { color: #ffffff; }
.footer a:hover { color: var(--accent-2); }
.footer .muted { color: #ffffff; }
.footer strong { color: #ffffff; }
.footer .copyright { text-align: center; color: #ffffff; font-weight: 800; margin-top: 26px; font-size: 14px; }
.footer .copyright a { color: #ffffff; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.footer .social { display: flex; gap: 14px; margin-top: 16px; }
.footer .social a { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 10px; background: rgba(255,255,255,.04); }
.footer .social a:hover { background: rgba(255,255,255,.10); }
.footer .social [data-lucide] { stroke: #ffffff; width: 18px; height: 18px; }
.footer .social a svg.brand { width: 18px; height: 18px; fill: #ffffff; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.foot-grid .col a { display: block; color: #ffffff; padding: 4px 0; font-size: 14px; }
.foot-grid .col a:hover { color: var(--accent-2); }

/* ── Auth pages: back-to-home + card rise-up animation ── */
@keyframes titan-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.titan-rise { animation: titan-rise .6s cubic-bezier(.2,.7,.2,1) both; }
.back-home { position: fixed; top: 18px; left: 18px; z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  color: #ffffff; font-weight: 600; font-size: 14px; padding: 9px 13px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: rgba(255,255,255,.05); }
.back-home:hover { background: rgba(255,255,255,.10); }
.back-home [data-lucide] { stroke: #ffffff; width: 18px; height: 18px; }

/* ── Scroll-to-top button ── */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  background: #1d4ed8; color: #fff; border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform .15s ease, background .15s ease;
}
.to-top:hover { background: #2456e6; transform: translateY(-2px); }
.to-top.show { display: inline-flex; }
.to-top [data-lucide] { stroke: #fff; width: 22px; height: 22px; }

/* ── Long-form legal / prose ── */
.prose { max-width: 820px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin: 0 0 6px; }
.prose .updated { color: var(--muted); font-size: 13px; margin: 0 0 30px; }
.prose h2 { font-size: 20px; font-weight: 700; margin: 30px 0 8px; }
.prose p, .prose li { color: #cfd6e4; font-size: 15px; }
.prose ul { padding-left: 20px; }
.prose a { color: var(--accent-2); }
.prose a:hover { text-decoration: underline; }

/* ── Pricing ── */
.price-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .price-grid { grid-template-columns: repeat(4, 1fr); } }
.tier { display: flex; flex-direction: column; }
.tier.white { background: #17191f; color: #fff; border-color: #3a3f4b; }
.tier.white .muted, .tier.white .feat-list li { color: #d7dce6; }
.tier.popular { background: #1d4ed8; border: 0; box-shadow: 0 18px 50px rgba(29,78,216,.45); position: relative; }
.tier.popular, .tier.popular .muted, .tier.popular .feat-list li { color: #fff; }
.tier .name { font-size: 18px; font-weight: 800; }
.tier .price { font-size: 40px; font-weight: 800; margin: 10px 0 2px; }
.tier .price span { font-size: 14px; font-weight: 600; opacity: .8; }
.tier .badge { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 800; letter-spacing: 1px;
  background: rgba(255,255,255,.22); padding: 4px 9px; border-radius: 999px; }
.feat-list { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; gap: 9px; flex: 1; }
.feat-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; }
.tier.white .feat-list [data-lucide] { stroke: #fff; width: 18px; height: 18px; }
.tier.popular .feat-list [data-lucide] { stroke: #fff; width: 18px; height: 18px; }
