/* ============================================================
   Tonywin Digits — shared base tokens
   Two surfaces: .surface-light (public) and .surface-dark (app).
   One brand accent (green) carries across both.
   ============================================================ */

:root {
  /* Brand accent — consistent across surfaces */
  --green: #0E9F6E;
  --green-dark: #0A7D56;
  --green-bright: #18B67F;

  /* Light surface */
  --l-bg: #ffffff;
  --l-panel: #f4f7f5;
  --l-raised: #ffffff;
  --l-ink: #0f1b14;
  --l-muted: #5b6b61;
  --l-line: #e3eae5;
  --l-shadow: 0 1px 2px rgba(15, 27, 20, .04), 0 8px 24px rgba(15, 27, 20, .06);

  /* Dark surface */
  --d-bg: #0e1613;
  --d-panel: #16211c;
  --d-raised: #1d2a24;
  --d-ink: #eaf2ed;
  --d-muted: #8aa096;
  --d-line: #263530;
  --d-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);

  /* Status */
  --ok: #18b67f;
  --warn: #e0a33a;
  --err: #e05a4f;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .container { padding: 0 16px; } }

/* Buttons (surface-neutral; colors set per surface) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-size: .98rem; font-weight: 600;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, background .15s ease, border-color .15s ease;
  text-align: center; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }

/* Visually hidden (for a11y labels) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Flash messages */
.flashes { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
  padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 500;
  box-shadow: var(--d-shadow); color: #fff; display: flex; gap: .6rem; align-items: flex-start;
  animation: flashIn .25s ease;
}
@keyframes flashIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.flash-success { background: #0e9f6e; }
.flash-error { background: #d7493e; }
.flash-info { background: #2f6f8f; }
.flash-warning { background: #c98a2a; }
.flash button { background: none; border: none; color: #fff; opacity: .8; cursor: pointer; font-size: 1.1rem; line-height: 1; margin-left: auto; }
