/* =====================================================
   COMPONENTS — the reusable "Soft Dark" primitives
   Class-based, matching the live Doinp site 1:1.
   React wrappers in /components render this same markup.
   ===================================================== */

/* -----------------------------------------------------
   SOFT PANEL  ·  .glass  (the shared surface)
   A subtle top→bottom ramp, hairline border, inset top
   highlight + long soft drop shadow. Everything sits on
   one of these.
   ----------------------------------------------------- */
.glass {
  position: relative;
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bot) 100%);
  border: 1px solid var(--hair);
  box-shadow: var(--shadow-panel);
  transition: transform var(--dur-slow) var(--ease-standard),
              box-shadow var(--dur-slow) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}

/* -----------------------------------------------------
   BUTTONS  ·  .btn  (+ --primary / --ghost)
   Primary = the tactile light pill. Ghost = a dark soft
   pill. Both lift 1px on hover.
   ----------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-normal);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              background var(--dur-base) var(--ease-standard);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn--primary {
  background: linear-gradient(180deg, var(--raised-top) 0%, var(--raised-bot) 100%);
  color: var(--raised-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(0, 0, 0, 0.12),
    0 8px 20px -8px rgba(0, 0, 0, 0.65);
}
.btn--primary:hover {
  transform: translateY(var(--lift));
  box-shadow: var(--shadow-raised-strong);
}

.btn--ghost {
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-bot) 100%);
  border-color: var(--hair-2);
  box-shadow: var(--shadow-ghost);
}
.btn--ghost:hover {
  transform: translateY(var(--lift));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 26px -10px rgba(0, 0, 0, 0.7);
}

/* -----------------------------------------------------
   TAGS / BADGES  ·  .tag  (+ .tag--live)
   Small uppercase chip on an inset surface. The live
   variant adds a glowing status dot.
   ----------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-tag);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-tag);
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--hair-2);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tag--live {
  gap: 7px;
  color: var(--text);
}
.tag--live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e7e8eb;
  box-shadow: 0 0 0 3px rgba(231, 232, 235, 0.16);
}
/* status badge with a colored dot (pill shape) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-pill);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(194, 196, 203, 0.16);
}

/* -----------------------------------------------------
   ICON TILE  ·  .icon-tile
   A small raised square that holds a stroked SVG icon.
   ----------------------------------------------------- */
.icon-tile {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-tile);
  color: var(--text);
  background: linear-gradient(180deg, #26262b 0%, #17171a 100%);
  border: 1px solid var(--hair-2);
  box-shadow: var(--shadow-tile);
}
.icon-tile svg { width: 19px; height: 19px; }

/* -----------------------------------------------------
   STAT / KPI  ·  .stat
   A big tabular number over a wide uppercase caption,
   sitting above a hairline. Profit reads green.
   ----------------------------------------------------- */
.stat { padding: 16px 0; border-top: 1px solid var(--hair); }
.stat__value {
  font-size: var(--fs-metric);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: var(--lh-tight);
  font-variant-numeric: tabular-nums;
}
.stat__value--strong { color: var(--text-strong); }
.stat__value.is-positive { color: var(--positive); }
.stat__caption {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 8px;
}

/* -----------------------------------------------------
   TEXT FIELD  ·  .field
   A centered tabular input pressed into a dark well.
   Focus adds a soft neutral ring; .is-bad turns it red.
   ----------------------------------------------------- */
.field {
  width: 100%;
  font-family: inherit;
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background: var(--well);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-tile);
  padding: 11px 12px;
  outline: none;
  box-shadow: var(--shadow-input);
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.field::placeholder { color: rgba(245, 246, 248, 0.30); font-weight: var(--fw-semibold); }
.field:focus {
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.field.is-bad {
  border-color: rgba(224, 106, 100, 0.6);
  color: var(--danger);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(224, 106, 100, 0.12);
}

/* -----------------------------------------------------
   TOGGLE SWITCH  ·  .switch
   Inset track, gradient knob that slides + turns light
   when on.
   ----------------------------------------------------- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 42px; height: 24px;
  border-radius: var(--radius-pill);
  background: var(--well);
  border: 1px solid var(--hair-2);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: border-color var(--dur-slow) var(--ease-standard);
}
.switch__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9a9ca3 0%, #6f7178 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform var(--dur-slow) var(--ease-slide), background var(--dur-slow) var(--ease-standard);
}
.switch.is-on .switch__track { border-color: rgba(255, 255, 255, 0.22); }
.switch.is-on .switch__knob {
  transform: translateX(18px);
  background: linear-gradient(180deg, var(--raised-top) 0%, var(--raised-bot) 100%);
}

/* -----------------------------------------------------
   SEGMENTED CONTROL  ·  .segmented
   An inset track with a light pill that slides under the
   active option (used for language + modal tabs).
   ----------------------------------------------------- */
.segmented {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: linear-gradient(180deg, var(--well) 0%, #101012 100%);
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-well);
}
.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 9px 15px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-standard), background var(--dur-base) var(--ease-standard);
}
.segmented button[aria-pressed="true"] {
  color: var(--raised-ink);
  background: linear-gradient(180deg, var(--raised-top) 0%, var(--raised-bot) 100%);
  box-shadow: var(--shadow-raised);
}

/* -----------------------------------------------------
   DATA TABLE  ·  .table
   Tabular-num grid inside a hairline-bordered, rounded
   wrap. Dark header row; rows highlight on hover and
   get a green rail when active.
   ----------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-14);
  border: 1px solid var(--hair);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.table thead th {
  text-align: center;
  font-size: 10.5px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 13px 18px;
  white-space: nowrap;
  background: #121214;
  border-bottom: 1px solid var(--hair);
}
.table tbody td {
  text-align: center;
  font-size: 14.5px;
  font-weight: var(--fw-semibold);
  color: var(--text);
  padding: 12px 18px;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background 130ms var(--ease-standard); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.table tbody tr.is-active { background: rgba(58, 208, 127, 0.09); }
.table tbody tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--positive); }

/* inline code */
code, .code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--well);
  border: 1px solid var(--hair);
  color: var(--text);
}
