/* ============================================================================
   Stellio — Design tokens
   Exact values from the specification (section 13). Every colour, radius and
   font size used in the app references a variable defined here, so the whole
   look can be reasoned about in one place.
   ============================================================================ */

:root {
  /* ── Colours (13.1) ─────────────────────────────────────────────────────── */
  --bg-main:      #03040A;   /* almost black, slightly bluish */
  --bg-second:    #0C0F18;   /* second layer */

  --card-bg:      rgba(8, 10, 22, 0.8);
  --card-border:  rgba(255, 255, 255, 0.06);
  --card-blur:    40px;

  --gold:         #C9A84C;   /* accent (primary) */
  --gold-light:   #F0D070;   /* accent (light) */
  /* gold button gradient: var(--gold) -> var(--gold-light) at 135deg */

  --text:         #F0F2FF;   /* primary text */
  --text-muted:   #6B7494;   /* secondary, grey-blue */
  --text-faint:   #252A40;   /* very muted / placeholder */

  --green:        #2DBF7A;   /* status ok */
  --red:          #E05555;   /* status error */

  /* ── Radii (13.3) ───────────────────────────────────────────────────────── */
  --r-card:   16px;
  --r-button: 12px;
  --r-small:  8px;
  --r-pill:   100px;

  /* ── Shadows (13.3) ─────────────────────────────────────────────────────── */
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.5);

  /* ── Fonts (13.2) ───────────────────────────────────────────────────────── */
  --font-title: 'Syne', sans-serif;
  --font-body:  'DM Sans', sans-serif;
}

/* ── Base reset ────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Typography scale (13.2) ─────────────────────────────────────────────────*/
.page-title  { font-family: var(--font-title); font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.tool-title  { font-family: var(--font-title); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.section-title { font-family: var(--font-title); font-weight: 700; font-size: 15px; }
.card-title  { font-family: var(--font-title); font-weight: 600; font-size: 14px; }

.field-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  display: block; margin-bottom: 6px;
}
.hint { font-size: 11px; color: var(--text-muted); }

/* ── Reusable surfaces ───────────────────────────────────────────────────────*/
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

/* ── Buttons (13.6) ──────────────────────────────────────────────────────────*/
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  border: none;
  border-radius: var(--r-button);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

/* Primary gold button */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-main);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 14px;
  height: 46px;
  padding: 0 22px;
  box-shadow: 0 4px 18px rgba(201, 168, 76, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(201, 168, 76, 0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Secondary / ghost button */
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  height: 42px;
  padding: 0 18px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }

.btn-full { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; }
.btn-danger { color: var(--red); border-color: rgba(224, 85, 85, 0.3); }
.btn-danger:hover { background: rgba(224, 85, 85, 0.08); }

/* ── Inputs (13.6) ───────────────────────────────────────────────────────────*/
input, textarea, select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 14px;
  height: 44px;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
textarea { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
  background: rgba(201, 168, 76, 0.02);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer; }

.form-group { margin-bottom: 14px; }

/* ── Pills (credits etc.) ────────────────────────────────────────────────────*/
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--gold);
  font-size: 12px; font-weight: 600;
}

/* ── Toast notifications ─────────────────────────────────────────────────────*/
#toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-second); border: 1px solid var(--card-border);
  color: var(--text); padding: 12px 20px; border-radius: var(--r-button);
  font-size: 13px; box-shadow: var(--shadow-soft);
  opacity: 0; pointer-events: none; transition: opacity 200ms, transform 200ms;
  z-index: 1000; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Loading spinner ─────────────────────────────────────────────────────────*/
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }

/* ── Entrance animation (section 15) ─────────────────────────────────────────*/
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease both; }

/* utility */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--card-border); margin: 18px 0; border: none; }
