/* RecordMyTime — shared design tokens & components.
   Dark, on-brand: matches the desktop client (dark surfaces, gold accent,
   time-of-day color). Loaded by both the landing page and the dashboard so
   the two read as one system. */

:root {
  /* surfaces */
  --bg:        #14141b;
  --bg-2:      #1a1a24;
  --surface:   #1e1e29;
  --surface-2: #24242f;
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  /* text */
  --text:  #e8e8ef;
  --muted: #9a9aab;
  --faint: #6b6b7b;

  /* brand */
  --gold:    #ecd97a; /* the client's 提交 button */
  --gold-2:  #f5e39a;
  --gold-dim:#c9b85f;
  --red:     #f0616e;
  --green:   #5fd68a;

  /* time-of-day accent — set live by JS (colorAtMinute). Falls back to a warm
     dawn tone so the page still looks intentional before JS runs. */
  --tod: #ff9a76;

  --radius:   14px;
  --radius-sm: 9px;
  --shadow:   0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

/* ---- buttons ---- */
button, .btn {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: background .15s ease, border-color .15s ease, transform .05s ease, opacity .15s ease;
  line-height: 1.2;
}
button:active, .btn:active { transform: translateY(1px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #2a2410;
  font-weight: 600;
  border: none;
}
.btn-gold:hover { background: linear-gradient(135deg, #fbeaad, var(--gold-2)); }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--border-2); }

.btn-link { background: none; color: var(--muted); padding: 6px 10px; }
.btn-link:hover { color: var(--text); }

input, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(236, 217, 122, 0.12);
}
input[type="date"] { color-scheme: dark; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- the breathing capsule (shared motif) ---- */
.capsule {
  --c: var(--tod);
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 22px 2px color-mix(in srgb, var(--c) 55%, transparent);
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 16px 1px color-mix(in srgb, var(--c) 40%, transparent); filter: brightness(0.92); }
  50%      { box-shadow: 0 0 34px 6px color-mix(in srgb, var(--c) 70%, transparent); filter: brightness(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .capsule { animation: none; }
}
