/* OpenedYet design system — shared tokens and components.
   Loaded first by every layout; site.css (marketing) and app.css (dashboard/admin) build on it. */

:root {
  /* brand */
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-100: #e0e7ff;
  --brand-50: #eef2ff;
  --opened: #10b981;        /* ✓✓ opened state */
  --opened-600: #059669;
  --opened-50: #ecfdf5;
  --sent: #94a3b8;          /* ✓ sent, not opened */
  --warn: #f59e0b;
  --warn-50: #fffbeb;
  --danger: #e11d48;
  --danger-50: #fff1f2;

  /* neutrals */
  --ink: #0f172a;
  --ink-2: #1e293b;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-tint: #f5f7ff;
  --night: #0b1020;         /* dark header / hero */
  --night-2: #141a33;

  /* type */
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* shape */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .14);
  --ring: 0 0 0 3px rgba(79, 70, 229, .25);
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo-word .yet { color: var(--brand); }
.logo.on-dark { color: #fff; }
.logo.on-dark .logo-word .yet { color: #a5b4fc; }

/* ---------- ticks ---------- */
.tick { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: -0.18em; color: var(--sent); }
.tick.opened { color: var(--opened); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-success { background: var(--opened); color: #fff; }
.btn-success:hover { background: var(--opened-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #be123c; color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--brand-50); color: var(--ink); }
.btn-lg { padding: 15px 26px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f8faff; border-color: #c6cbd2; color: #1f1f1f; }
.btn-google svg { width: 18px; height: 18px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 10px;
  font: 15px/1.4 var(--font); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--brand); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

/* ---------- alerts / badges / cards ---------- */
.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 15px; margin-bottom: 16px; }
.alert-success { background: var(--opened-50); border-color: #a7f3d0; color: #065f46; }
.alert-error { background: var(--danger-50); border-color: #fecdd3; color: #9f1239; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.alert-warn { background: var(--warn-50); border-color: #fde68a; color: #92400e; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge-opened { background: var(--opened-50); color: var(--opened-600); border-color: #a7f3d0; }
.badge-warn { background: var(--warn-50); color: #b45309; border-color: #fde68a; }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: #fecdd3; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- minimal layout (login, install, connect, opt-out, errors) ---------- */
body.minimal { background: radial-gradient(1200px 600px at 50% -10%, var(--brand-50), transparent 70%), var(--bg-soft); min-height: 100vh; }
.minimal-main { max-width: 480px; margin: 0 auto; padding: 48px 16px 64px; }
.minimal-main.wide { max-width: 720px; }
.minimal-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.minimal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; }
.minimal-title { font-size: 1.6rem; margin-bottom: 8px; }
.minimal-text { color: var(--muted); }
.minimal-foot { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.minimal-foot a { color: var(--muted); text-decoration: underline; }
@media (max-width: 520px) { .minimal-card { padding: 24px 18px; } }
