/* ── WingsNBeaks — shared stylesheet ───────────────────────────────────────── */

:root {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface2:   #22263a;
  --border:     #2e3350;
  --text:       #e8eaf2;
  --text-muted: #8b90a8;
  --accent:     #4f8ef7;
  --accent-h:   #3a72d4;
  --correct:    #34d17a;
  --wrong:      #f75b5b;
  --radius:     10px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

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

/* ── Layout ──────────────────────────────────────────────────────────────────── */

.page-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.header-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.header-auth a { color: var(--accent); }

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--text-muted); margin: 0 0.5rem; }
footer a:hover { color: var(--text); text-decoration: none; }

/* ── Typography ──────────────────────────────────────────────────────────────── */

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
p  { color: var(--text-muted); margin-bottom: 1rem; }
p.lead { font-size: 1.05rem; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary  { background: var(--accent);  color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--accent-h); text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { background: var(--surface2); text-decoration: none; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.form-group label .note {
  font-style: italic;
  font-weight: 400;
  font-size: 0.82rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 130px; }

select option { background: var(--surface2); }

.form-note {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-style: italic;
}

.form-feedback {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 1rem;
  display: none;
}
.form-feedback.success { background: rgba(52,209,122,0.12); color: var(--correct); display: block; }
.form-feedback.error   { background: rgba(247,91,91,0.12);  color: var(--wrong);   display: block; }

/* ── Level tabs ──────────────────────────────────────────────────────────────── */

.level-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.level-tab {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
}
.level-tab:hover   { border-color: var(--accent); color: var(--text); }
.level-tab.active  { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Quiz card ───────────────────────────────────────────────────────────────── */

.quiz-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  background: var(--surface2);
}

.quiz-question {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
@media (max-width: 500px) {
  .answer-grid { grid-template-columns: 1fr; }
}

.answer-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.92rem;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface);
}
.answer-btn.correct {
  border-color: var(--correct);
  background: rgba(52,209,122,0.1);
  color: var(--correct);
}
.answer-btn.wrong {
  border-color: var(--wrong);
  background: rgba(247,91,91,0.1);
  color: var(--wrong);
}
.answer-btn:disabled { cursor: default; }

.quiz-feedback {
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: none;
}
.quiz-feedback.correct { background: rgba(52,209,122,0.1); color: var(--correct); display: block; }
.quiz-feedback.wrong   { background: rgba(247,91,91,0.1);  color: var(--wrong);   display: block; }

.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.score-bar .taxon-filter,
.score-bar .region-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.score-bar select {
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  width: auto;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 { font-size: 2.6rem; }
.hero p.lead { max-width: 480px; margin: 0.75rem auto 2rem; }

.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 580px) {
  .how-it-works { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.step-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.step-card h3 { font-size: 0.95rem; color: var(--text); margin-bottom: 0.3rem; }
.step-card p  { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ── Auth modal ──────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}
.modal h2 { margin-bottom: 1.25rem; }
.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.modal-tab {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.modal-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1rem 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.btn-google {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.btn-google:hover { background: var(--surface); text-decoration: none; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  margin-top: -0.25rem;
}

/* ── Profile page ────────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 500px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-box .value { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-box .label { font-size: 0.8rem; color: var(--text-muted); }

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
}
.badge.earned { border-color: var(--accent); }
.badge .badge-icon { font-size: 1.5rem; margin-bottom: 0.35rem; }
.badge .badge-name { color: var(--text-muted); }
.badge.earned .badge-name { color: var(--text); }
.badge.locked { opacity: 0.4; }

/* ── About / Privacy content ─────────────────────────────────────────────────── */

.content-page h1 { margin-bottom: 0.5rem; }
.content-page section { margin-bottom: 2rem; }
.content-page h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin-bottom: 0.75rem; }
.content-page p  { margin-bottom: 0.75rem; }
.content-page ul { padding-left: 1.4rem; color: var(--text-muted); }
.content-page ul li { margin-bottom: 0.3rem; }

/* ── Utilities ───────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.88rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
