/* ============================================================
   Tickr SaaS Earnings — shared CSS
   Loaded by every page (dashboard, signup, login, billing, etc.)
   ============================================================ */

@import url("colors_and_type.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  --font-display: "Inter", "Lato", system-ui, sans-serif;
  --font-body:    "Inter", "Lato", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bg-page:      #F1F2F4;
  --tile-border:  rgba(15,17,22,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button { font-family: inherit; }

a { color: var(--signal-green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== Top nav ===================== */
.top-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--tile-border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 50;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-mark {
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  color: var(--fg-1); letter-spacing: -0.025em;
  line-height: 1;
}
.nav-suffix {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  color: var(--fg-3);
  padding: 3px 7px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-page);
  margin-left: 4px;
  letter-spacing: 0;
}
.nav-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--signal-green); color: #fff;
  border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 120ms ease;
}
.user-avatar:hover { transform: scale(1.05); }
.user-menu {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: 14px;
  width: 260px;
  box-shadow: 0 16px 40px rgba(15,17,22,0.10), 0 4px 8px rgba(15,17,22,0.04);
  overflow: hidden;
  padding: 6px;
}
.um-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--tile-border);
  margin-bottom: 6px;
}
.um-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--signal-green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.um-head > div:last-child { flex: 1; min-width: 0; }
.um-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--fg-1); }
.um-email { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-plan {
  display: inline-block; margin-top: 6px;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--signal-green-soft); color: var(--signal-green-ink);
  padding: 2px 7px; border-radius: 4px;
}
.um-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  width: 100%;
  background: transparent; border: none;
  text-align: left;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--fg-1); text-decoration: none;
  cursor: pointer;
}
.um-item:hover { background: var(--slate-50); text-decoration: none; }
.um-item svg { color: var(--fg-3); flex-shrink: 0; }
.um-item:hover svg { color: var(--fg-1); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { height: 36px; font-size: 13px; padding: 0 14px; }
.btn-lg { height: 48px; font-size: 15px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--signal-green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--signal-green-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--fg-1); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--slate-50); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--fg-1); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-danger {
  background: transparent; color: var(--market-down);
  border-color: rgba(193,56,56,0.30);
}
.btn-danger:hover { background: var(--market-down-soft); border-color: var(--market-down); }

/* ===================== Form fields ===================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--fg-1);
}
.field-help { font-size: 12px; color: var(--fg-3); }
.field-error { font-size: 12px; color: var(--market-down); font-weight: 600; }
.input {
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 0 14px;
  font-family: inherit; font-size: 14px;
  color: var(--fg-1);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--signal-green);
  box-shadow: 0 0 0 3px rgba(26,127,78,0.15);
}
.input::placeholder { color: var(--fg-muted); }

/* ===================== Auth split-screen ===================== */
.auth-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: var(--signal-green);
  color: #fff;
  padding: 56px 56px 48px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 85% 30%, rgba(255,255,255,0.07), transparent 45%),
    radial-gradient(circle at 12% 90%, rgba(255,255,255,0.05), transparent 50%),
    radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: auto, auto, 18px 18px;
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .ab-eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 10px;
}
.auth-brand h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 0.98; letter-spacing: -0.045em;
  margin: 0;
  color: #fff;
  text-wrap: balance;
}
.auth-brand .ab-tag {
  margin-top: 20px;
  font-size: 17px; line-height: 1.5;
  color: rgba(255,255,255,0.86);
  max-width: 460px;
}
.auth-brand .ab-foot {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  font-family: var(--font-mono);
}
.auth-brand .ab-foot strong { color: #BFEBD0; font-weight: 700; font-family: var(--font-display); }

.auth-form-wrap {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.auth-form {
  width: 100%; max-width: 380px;
}
.auth-form h2 {
  font-family: var(--font-display); font-weight: 900; font-size: 28px;
  letter-spacing: -0.025em; margin: 0 0 8px;
  color: var(--fg-1);
}
.auth-form .sub {
  font-size: 14px; color: var(--fg-2); margin: 0 0 28px; line-height: 1.5;
}
.auth-form .sub a { color: var(--signal-green); font-weight: 700; }
.auth-foot {
  text-align: center;
  font-size: 13px; color: var(--fg-2);
  margin-top: 20px;
}
.auth-foot a { color: var(--signal-green); font-weight: 700; }
.field-row { display: flex; align-items: center; justify-content: space-between; }
.field-row a { font-size: 12px; color: var(--signal-green); font-weight: 700; }

/* ===================== Page shell ===================== */
.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.page-shell h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: 36px; letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.page-shell .lede {
  font-size: 16px; color: var(--fg-2); margin: 0 0 32px; max-width: 600px;
}

/* ===================== Banners ===================== */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13px;
  background: var(--amber-soft); color: var(--amber-ink);
  border: 1px solid rgba(194,132,26,0.3);
  line-height: 1.5;
}
.banner.success { background: var(--signal-green-soft); color: var(--signal-green-ink); border-color: rgba(26,127,78,0.3); }
.banner.info { background: var(--info-soft); color: var(--info); border-color: rgba(44,91,217,0.3); }
.banner svg { flex-shrink: 0; }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.banner .banner-action { margin-left: auto; }

/* ===================== Pricing / plans ===================== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: 16px;
  padding: 28px;
  display: flex; flex-direction: column;
  position: relative;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.plan-card.featured {
  border-color: var(--signal-green);
  box-shadow: 0 12px 36px rgba(26,127,78,0.12);
}
.plan-card.current { border-color: var(--ink); }
.plan-card .ribbon {
  position: absolute; top: -10px; left: 24px;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 5px;
}
.plan-card.featured .ribbon { background: var(--signal-green); color: #fff; }
.plan-card.current .ribbon { background: var(--ink); color: #fff; }
.plan-card .name {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: -0.01em;
}
.plan-card .price {
  font-family: var(--font-display); font-weight: 900;
  font-size: 44px; letter-spacing: -0.025em;
  margin-top: 14px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan-card .price small {
  font-family: var(--font-body); font-size: 14px;
  font-weight: 500; color: var(--fg-3);
  margin-left: 4px;
}
.plan-card .tag {
  font-size: 13px; color: var(--fg-2); margin-top: 8px; line-height: 1.4;
}
.plan-card ul {
  margin: 22px 0 0;
  padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.plan-card li {
  font-size: 13px; color: var(--fg-1); line-height: 1.45;
  display: flex; gap: 8px; align-items: flex-start;
}
.plan-card li::before {
  content: ""; width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A7F4E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain; background-repeat: no-repeat;
}
.plan-card .btn-block { margin-top: 24px; }

/* ===================== Billing summary ===================== */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.summary-card h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  margin: 0 0 4px;
}
.summary-card .lede { font-size: 13px; color: var(--fg-3); margin: 0 0 16px; }
.summary-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--tile-border);
}
.summary-row:first-of-type { border-top: none; padding-top: 4px; }
.summary-row .lbl { color: var(--fg-2); font-size: 13px; }
.summary-row .val { font-family: var(--font-mono); font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.summary-row .val.signal { color: var(--signal-green); }

/* ===================== Stripe-style card form ===================== */
.card-form {
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
}
.card-form h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  margin: 0 0 4px;
}
.card-form .ledge { font-size: 13px; color: var(--fg-3); margin: 0 0 20px; }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-input-group {
  position: relative;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--surface);
  display: flex; align-items: center;
  height: 44px;
  padding: 0 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.card-input-group:focus-within {
  border-color: var(--signal-green);
  box-shadow: 0 0 0 3px rgba(26,127,78,0.15);
}
.card-input-group input {
  border: none; outline: none; background: transparent;
  width: 100%; height: 100%; font-family: inherit;
  font-size: 14px; color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.card-input-group .brand-icons { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.brand-icon {
  height: 22px; min-width: 30px; border-radius: 4px;
  background: var(--slate-100);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 9px;
  color: var(--fg-3);
}
.brand-icon.visa { background: #1434CB; color: #fff; }
.brand-icon.mc   { background: #EB001B; color: #fff; }
.brand-icon.amex { background: #006FCF; color: #fff; }

/* ===================== Verify email ===================== */
.verify-card {
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
}
.verify-card .icon-circ {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--signal-green-soft); color: var(--signal-green);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.verify-card h2 {
  font-family: var(--font-display); font-weight: 900; font-size: 26px;
  letter-spacing: -0.025em; margin: 0 0 10px;
}
.verify-card p {
  font-size: 14px; color: var(--fg-2); line-height: 1.55;
  margin: 0 0 24px;
}
.verify-card .email-emph { font-family: var(--font-mono); color: var(--fg-1); font-weight: 700; }
.verify-card .demo-link {
  display: inline-block; margin-top: 16px;
  font-size: 12px; color: var(--fg-3);
  border-top: 1px dashed var(--border-default);
  padding-top: 16px;
}
.verify-card .demo-link a { color: var(--signal-green); font-weight: 700; }

/* ===================== Loading spinner ===================== */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Responsive ===================== */
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-brand { padding: 32px 24px 28px; }
  .auth-brand h1 { font-size: clamp(34px, 9vw, 48px); }
  .auth-brand .ab-tag { font-size: 15px; margin-top: 14px; }
  .auth-form-wrap { padding: 36px 24px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .top-nav { padding: 0 16px; }
  .nav-suffix { display: none; }
  .page-shell { padding: 28px 16px 48px; }
  .page-shell h1 { font-size: 28px; }
}
