/* =====================================================================
   RINGER UI — design system stylesheet · v1.0

   The reusable "look" for our products. Product-agnostic: no page or
   feature lives here, only design tokens + primitive/layout classes.
   Import once (`import './ringer-ui.css'` or a <link>) and build with
   the classes below. Re-theme everything by editing the :root tokens.
   ===================================================================== */

:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Surfaces */
  --bg: #070d2b;
  --bg-2: #10174a;
  --panel: rgba(18, 25, 72, 0.84);
  --panel-solid: #11194d;
  --border: rgba(210, 190, 255, 0.18);

  /* Text (three levels — use all three) */
  --text: #f7f4ff;
  --muted: #c9c3e8;
  --soft: #9c93c9;

  /* Accents */
  --accent: #bc83f0;     /* primary — orchid/purple             */
  --accent-2: #8d54ce;   /* gradient end — deeper violet        */
  --accent-3: #64d2df;   /* secondary — cyan (success/highlight)*/

  /* Feedback */
  --danger: #ffd8e0;
  --danger-bg: rgba(255, 221, 230, 0.1);

  /* Data-viz — categorical (assign in order) */
  --viz-1: #9b63ff; --viz-2: #61d2c8; --viz-3: #70a2ff; --viz-4: #f7c948;
  --viz-5: #ef6f82; --viz-6: #a78bfa; --viz-7: #5ad083; --viz-8: #f472b6;

  /* Data-viz — semantic low/mid/high */
  --score-weak: #ef6f82; --score-mixed: #f7c948; --score-strong: #5ad083;

  /* Radii */
  --r-pill: 999px; --r-sm: 12px; --r-input: 14px; --r-md: 18px;
  --r-lg: 22px; --r-card: 24px; --r-hero: 30px;

  /* Elevation + motion */
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.24);
  --shadow-hero: 0 30px 70px rgba(0, 0, 0, 0.34);
  --shadow-accent: 0 12px 26px rgba(141, 84, 206, 0.32);
  --blur: 16px;
  --ease: 180ms ease;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, var(--accent), var(--accent-2));
  --grad-progress: linear-gradient(90deg, var(--accent), var(--accent-3));
  --grad-glass: linear-gradient(135deg, rgba(188, 131, 240, 0.22), rgba(100, 210, 223, 0.12));

  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
}

/* --- reset + signature background ---------------------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 8%, rgba(188, 131, 240, 0.35), transparent 34%),
    radial-gradient(circle at 12% 42%, rgba(100, 210, 223, 0.16), transparent 32%),
    linear-gradient(180deg, #070d2b 0%, #101447 48%, #070d2b 100%);
}
body::before { /* decorative diagonal light streaks */
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: 0.34;
  background-image:
    linear-gradient(130deg, transparent 0 18%, rgba(188, 131, 240, 0.32) 18.3%, transparent 18.8% 48%, rgba(188, 131, 240, 0.18) 48.2%, transparent 48.8%),
    linear-gradient(18deg, transparent 0 34%, rgba(100, 210, 223, 0.14) 34.2%, transparent 34.8% 76%, rgba(188, 131, 240, 0.18) 76.2%, transparent 76.8%);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

/* --- layout --------------------------------------------------------- */
.page { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 28px; }
.stack { display: grid; gap: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* --- typography ----------------------------------------------------- */
h1 { font-size: clamp(42px, 6vw, 76px); line-height: 0.96; letter-spacing: -0.055em; margin: 0 0 22px; max-width: 840px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
h3 { margin: 0 0 4px; font-size: 17px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--accent); font-weight: 800; margin: 0 0 12px; }
.lede { margin: 0; max-width: 780px; color: #e5ddfb; font-size: 19px; line-height: 1.6; }
.muted { color: var(--muted); line-height: 1.55; }
.soft { color: var(--soft); }

/* --- top bar + brand ------------------------------------------------ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; }
.brand .mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: #fff; background: var(--grad-accent); }

/* --- surfaces ------------------------------------------------------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 24px; box-shadow: var(--shadow-card); backdrop-filter: blur(var(--blur));
}
.hero {
  position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-hero); box-shadow: var(--shadow-hero); padding: 52px 44px; margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(11, 18, 52, 0.96), rgba(44, 31, 91, 0.9)),
    radial-gradient(circle at 82% 8%, rgba(188, 131, 240, 0.5), transparent 40%);
}
.section-head { margin: 34px 0 14px; }

/* --- buttons -------------------------------------------------------- */
.btn, .btn-primary, .btn-ghost, .btn-danger {
  cursor: pointer; border-radius: var(--r-pill); font-weight: 800; padding: 9px 14px;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  transition: transform var(--ease), border-color var(--ease), background var(--ease), opacity var(--ease);
}
.btn:hover, .btn-primary:hover, .btn-ghost:hover, .btn-danger:hover { transform: translateY(-1px); }
.btn-primary { border: 1px solid rgba(188, 131, 240, 0.64); background: var(--grad-accent); color: #fff; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.btn-danger { border: 1px solid rgba(255, 216, 224, 0.4); background: rgba(255, 216, 224, 0.12); color: var(--danger); }
.btn-cta {
  width: 100%; border: 0; background: var(--grad-accent); color: #fff; border-radius: 16px;
  padding: 14px 18px; font-weight: 900; box-shadow: var(--shadow-accent); cursor: pointer;
  transition: transform var(--ease), opacity var(--ease);
}
.btn-cta:hover { transform: translateY(-1px); }
.btn:disabled, .btn-primary:disabled, .btn-ghost:disabled, .btn-cta:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* --- pills / chips / segmented ------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; color: #f5efff;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 12px; border-radius: var(--r-pill); font-size: 13px; text-decoration: none;
}
.chip {
  cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.07);
  color: var(--muted); border-radius: var(--r-pill); padding: 8px 12px;
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
}
.chip:hover { transform: translateY(-1px); }
.chip.selected { background: rgba(188, 131, 240, 0.2); color: #fff; border-color: rgba(188, 131, 240, 0.8); }
.segment {
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: #f8fafc;
  border-radius: var(--r-pill); padding: 10px 16px; cursor: pointer; font-weight: 700;
  transition: background var(--ease), border-color var(--ease);
}
.segment.selected { background: rgba(167, 139, 250, 0.22); border-color: rgba(196, 181, 253, 0.65); }

/* --- forms ---------------------------------------------------------- */
label { display: block; font-weight: 750; margin: 16px 0 8px; color: #f5efff; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input:not([type]), select, textarea {
  width: 100%; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--r-input);
  padding: 12px 13px; color: #fff; background: rgba(6, 10, 35, 0.7); outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(188, 131, 240, 0.75); box-shadow: 0 0 0 4px rgba(188, 131, 240, 0.13);
}
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.file-drop {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 96px;
  border: 1px dashed rgba(188, 131, 240, 0.7); border-radius: var(--r-md); color: #f8f2ff;
  background: rgba(188, 131, 240, 0.08); cursor: pointer; font-weight: 800;
}

/* --- feedback ------------------------------------------------------- */
.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255, 216, 224, 0.28); border-radius: var(--r-md); padding: 14px 16px; }
.notice { border-radius: var(--r-md); padding: 14px 16px; color: #f8f2ff; background: rgba(100, 210, 223, 0.12); border: 1px solid rgba(100, 210, 223, 0.34); }
.status-pill { border-radius: var(--r-pill); padding: 8px 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.13); text-transform: capitalize; font-weight: 800; }
.status-pill.success { background: rgba(100, 210, 223, 0.14); border-color: rgba(100, 210, 223, 0.35); }
.status-pill.error { background: rgba(255, 216, 224, 0.1); border-color: rgba(255, 216, 224, 0.28); }
.progress { height: 13px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad-progress); transition: width 250ms ease; }

/* --- metric / KPI card --------------------------------------------- */
.metric {
  padding: 18px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.11); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}
.metric > span { display: block; color: rgba(245, 239, 255, 0.78); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; font-weight: 800; }
.metric > strong { display: block; margin-top: 10px; font-size: 34px; color: #fff; letter-spacing: -0.04em; }
.metric > p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.metric.featured { background: linear-gradient(135deg, rgba(188, 131, 240, 0.98), rgba(141, 84, 206, 0.92)); border-color: rgba(255, 255, 255, 0.26); }
.metric.featured > p { color: rgba(255, 255, 255, 0.9); }

/* --- table ---------------------------------------------------------- */
.table-wrap { overflow: auto; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: rgba(7, 13, 43, 0.45); }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
th { color: #efe8ff; background: rgba(255, 255, 255, 0.05); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
td { color: var(--muted); }

/* --- responsive ----------------------------------------------------- */
@media (max-width: 860px) {
  .page { padding: 18px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 34px 24px; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
