/* ============================================================================
 * MARID — styles. Colour values flow from the BRAND constant via CSS custom
 * properties set in app.js (applyBrand). Nothing brand-specific lives here.
 *
 * THE DESIGN LAWS (ARZU family):
 *  - Boxes/buttons = SOLID dark fill inside (text always readable) with an
 *    iridescent OUTLINE — a thin multi-hue line on the OUTSIDE edge ONLY,
 *    via padding-box / border-box. NEVER an iridescent or gradient fill
 *    behind text.
 *  - Iridescent ≠ gradient: multi-hue (violet→cobalt→cyan→teal→magenta),
 *    and it moves SLOWLY (24s). Fast = rejected.
 *  - Headings = iridescent colour fill. Body text = solid, high contrast.
 *  - A− / A / A+ text sizing and a light/dark toggle, both persistent for
 *    the session.
 * ==========================================================================*/

:root {
  --ink: #0B0B10;
  --irid-a: #7B3FE4;
  --irid-b: #1F4FE0;
  --irid-c: #35E0FF;
  --irid-d: #2BE8A0;
  --irid-e: #E040C8;
  --live: #2BFF88;
  --warn: #FFB020;
  --danger: #FF5470;

  --font-scale: 1;

  /* dark mode (default) */
  --bg: var(--ink);
  --fill: #12121A;                 /* the SOLID box fill — never a gradient */
  --fill-2: #191926;
  --text: rgba(255, 255, 255, 0.93);
  --text-dim: rgba(255, 255, 255, 0.58);
  --text-faint: rgba(255, 255, 255, 0.36);
  --line: rgba(255, 255, 255, 0.10);

  /* the iridescent OUTLINE — multi-hue conic, teal/green included */
  --irid-ring: conic-gradient(from var(--ring-ang, 0deg),
    var(--irid-a), var(--irid-b), var(--irid-c), var(--irid-d),
    var(--irid-e), var(--irid-a));
}
body.light {
  --bg: #F3F3F8;
  --fill: #FFFFFF;
  --fill-2: #F7F7FC;
  --text: rgba(16, 16, 26, 0.92);
  --text-dim: rgba(16, 16, 26, 0.60);
  --text-faint: rgba(16, 16, 26, 0.38);
  --line: rgba(16, 16, 26, 0.12);
}

@property --ring-ang { syntax: '<angle>'; initial-value: 0deg; inherits: true; }
@keyframes ring-turn { to { --ring-ang: 360deg; } }   /* SLOW. gentle. */

* { box-sizing: border-box; }
html { font-size: calc(17px * var(--font-scale)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  animation: ring-turn 24s linear infinite;   /* one slow shared sweep */
}
body:not(.light) {
  background:
    radial-gradient(1100px 700px at 88% -10%, rgba(123, 63, 228, 0.13), transparent 60%),
    radial-gradient(900px 650px at -8% 108%, rgba(43, 232, 160, 0.07), transparent 55%),
    var(--bg);
}
h1, h2, h3 { font-family: 'Sora', 'Inter', system-ui, sans-serif; letter-spacing: -0.01em; }

/* ---- iridescent HEADINGS: colour-filled type, the signature ------------- */
.irid-text {
  background: linear-gradient(110deg, var(--irid-a) 0%, var(--irid-c) 30%,
    var(--irid-d) 52%, var(--irid-b) 74%, var(--irid-e) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: irid-sweep 24s linear infinite;
}
@keyframes irid-sweep { to { background-position: 200% center; } }

/* ---- THE BOX: solid fill + iridescent OUTLINE only ---------------------- */
.box {
  background: linear-gradient(var(--fill), var(--fill)) padding-box,
              var(--irid-ring) border-box;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);   /* subtle glass shine */
}
body.light .box { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.box + .box { margin-top: 16px; }
.box h2, .box h3 { margin-top: 0; }
.box .sub { color: var(--text-dim); font-size: 0.9rem; }

/* quiet variant for secondary panels — plain hairline, no ring */
.panel {
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.panel + .panel { margin-top: 12px; }

/* ---- layout ------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: 0 0 240px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.content { flex: 1; padding: 26px clamp(18px, 4vw, 48px); width: 100%; min-width: 0; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px;
  background: linear-gradient(var(--fill-2), var(--fill-2)) padding-box, var(--irid-ring) border-box;
  border: 2px solid transparent;
  display: grid; place-items: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.05rem;
}
.brand-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.2rem; }
.brand-by { font-size: 0.68rem; color: var(--text-faint); letter-spacing: 0.14em; text-transform: uppercase; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-size: 0.95rem;
  background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { color: var(--text); background: var(--fill-2); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(var(--fill-2), var(--fill-2)) padding-box, var(--irid-ring) border-box;
  border: 1px solid transparent;
}
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.topbar { display: none; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.65rem; }

/* ---- buttons: solid fill, iridescent outline ---------------------------- */
.btn {
  background: linear-gradient(var(--fill-2), var(--fill-2)) padding-box, var(--irid-ring) border-box;
  border: 2px solid transparent;
  color: var(--text);
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 0.94rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: filter 0.12s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn.quiet { background: var(--fill-2); border: 1px solid var(--line); box-shadow: none; font-weight: 500; }
.btn.small { padding: 6px 11px; font-size: 0.82rem; border-radius: 9px; }
.btn.danger { border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: var(--fill-2); color: var(--danger); box-shadow: none; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* ---- forms -------------------------------------------------------------- */
label.field { display: block; margin: 12px 0 6px; font-size: 0.86rem; color: var(--text-dim); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], textarea, select {
  width: 100%;
  background: var(--fill-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem; font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--irid-c); }

.tick { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 0.9rem; }
.tick input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--irid-a); flex: 0 0 17px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.seg button {
  background: var(--fill-2); color: var(--text-dim); border: none; padding: 9px 14px;
  font-family: inherit; font-size: 0.88rem; cursor: pointer;
}
.seg button.on { background: var(--fill); color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--irid-c); }

/* ---- bits --------------------------------------------------------------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; }
.pill.live { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pill.dim { background: var(--fill-2); color: var(--text-dim); }

.est-line { font-size: 1.06rem; font-weight: 700; margin: 10px 0 2px; }
.note { color: var(--text-dim); font-size: 0.84rem; line-height: 1.5; }
.error-line { color: var(--danger); font-size: 0.9rem; margin-top: 10px; white-space: pre-wrap; }
.good-line { color: var(--live); font-size: 0.9rem; margin-top: 10px; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.list th { text-align: left; color: var(--text-faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); }

.age-badge { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 6px; padding: 2px 7px; }

video.preview, audio.preview { width: 100%; margin-top: 12px; border-radius: 12px; background: #000; }

/* ---- mobile ------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: var(--bg); z-index: 5;
  }
  .topbar .nav-item { width: auto; padding: 7px 10px; font-size: 0.85rem; }
  .content { padding: 18px 14px; }
}
