/* ═══════════════════════════════════════════════════════════
   PRV Captcha — design system (yellow + white, modern SaaS)
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #fffdf4;
  --surface: #ffffff;
  --surface-2: #fff8e1;
  --border: #f0e4bf;
  --border-strong: #e6d7a8;
  --primary: #f7b500;
  --primary-2: #e0a300;
  --primary-soft: #fff3c4;
  --text: #211a07;
  --text-2: #6b5d2e;
  --muted: #a6955c;
  --success: #16a34a;
  --success-soft: #e7f8ee;
  --danger: #e11d48;
  --danger-soft: #ffe4ea;
  --warning: #d97706;
  --warning-soft: #fff3c4;
  --shadow: 0 1px 3px rgba(33, 26, 7, .05), 0 6px 24px rgba(33, 26, 7, .05);
  --shadow-lg: 0 12px 40px rgba(33, 26, 7, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Header ─────────────────────────────────────────── */
.header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  background: var(--primary); color: #1a1508; width: 34px; height: 34px;
  border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: .82rem;
  letter-spacing: -.02em; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.brand img.logo-img { height: 30px; width: auto; flex-shrink: 0; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 15px; border-radius: 10px; font-size: .86rem; font-weight: 600;
  color: var(--text-2); transition: .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: #8a6d00; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-size: .88rem; font-weight: 700;
  border: 1px solid transparent; transition: .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #1a1508; border-color: var(--primary); box-shadow: 0 4px 14px rgba(247,181,0,.35); }
.btn-primary:hover { background: var(--primary-2); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0173d; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Cards & layout ─────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 36px 24px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }

/* ── Stat cards ─────────────────────────────────────── */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.stat .label { font-size: .74rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 8px; }
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.stat .value.accent { color: var(--primary-2); }
.stat .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* ── Forms ──────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.input {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--border); border-radius: 12px;
  font-size: .92rem; background: var(--surface); color: var(--text); transition: .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(247,181,0,.15); }
.input::placeholder { color: var(--muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b5d2e' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* ── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th {
  text-align: left; padding: 12px 16px; background: var(--surface-2);
  color: var(--text-2); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fffdf4; }

/* ── Badges ─────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-failed { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }
.badge-primary { background: var(--primary-soft); color: #8a6d00; }

/* ── Tabs / filter pills ────────────────────────────── */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 7px 15px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: .15s;
}
.pill:hover { border-color: var(--primary); }
.pill.active { background: var(--primary); color: #1a1508; border-color: var(--primary); }

/* ── Toast ──────────────────────────────────────────── */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 12px; padding: 13px 18px; box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 600;
  animation: slideIn .25s ease; max-width: 340px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Modal ──────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(33,26,7,.4); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 500; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px; width: 100%; max-width: 460px; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 1.2rem; margin-bottom: 18px; }

/* ── Landing hero ───────────────────────────────────── */
.hero { text-align: center; padding: 70px 24px 40px; max-width: 780px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 800; }
.hero h1 .hl { color: var(--primary-2); }
.hero p { color: var(--text-2); font-size: 1.12rem; margin: 20px auto 30px; max-width: 560px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-align: center; box-shadow: var(--shadow); position: relative; }
.price-card.featured { border-color: var(--primary); box-shadow: 0 12px 40px rgba(247,181,0,.18); }
.price-card .name { font-weight: 800; font-size: 1rem; }
.price-card .per { color: var(--muted); font-size: .8rem; margin: 4px 0 18px; }
.price-card .amount { font-size: 2.2rem; font-weight: 800; color: var(--text); }
.price-card .unit { color: var(--muted); font-size: .78rem; margin: 4px 0 20px; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 14px; }
.feature h3 { font-size: .98rem; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: .86rem; }

/* ── Auth pages ─────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-2); font-size: .9rem; margin-bottom: 24px; }

/* ── Dashboard layout ───────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.api-key-box {
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: .82rem; word-break: break-all;
}
.copy-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: .78rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.copy-btn:hover { border-color: var(--primary); color: var(--text); }

/* ── Admin ──────────────────────────────────────────── */
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.footer { border-top: 1px solid var(--border); padding: 28px 24px; text-align: center; color: var(--muted); font-size: .84rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .pricing, .feature-row { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .header { padding: 0 16px; }
  .nav a { padding: 7px 11px; font-size: .8rem; }
}
