/* ============================================================
   base.css — Reset, global typography, utility classes
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 17px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

p { color: var(--text2); font-size: 13px; }

.mono { font-family: var(--font-mono); }

/* ── Form elements ── */
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

body.light input:focus,
body.light select:focus,
body.light textarea:focus {
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--text2);
  opacity: 0.7;
}

select option {
  background: var(--card);
  color: var(--text);
}

textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  line-height: 1;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.12); }

.btn-ghost {
  background: rgba(128,128,128,.1);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(128,128,128,.18); }

.btn-danger {
  background: rgba(207,34,46,.1);
  color: var(--red);
  border: 1px solid rgba(207,34,46,.25);
}
.btn-danger:hover { background: rgba(207,34,46,.18); }

.btn-full  { width: 100%; justify-content: center; }
.btn-sm    { padding: 7px 13px; font-size: 12px; }

/* ── Utility ── */
.green  { color: var(--green) !important; }
.red    { color: var(--red) !important; }
.accent { color: var(--accent2) !important; }

/* ── Form group ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-full { grid-column: 1 / -1; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }

/* ── Page sections ── */
.page { display: none; }
.page.active { display: block; }

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
