/* ═══════════════════════════════════════════
   TripOps — Styles
   Font: DM Sans + Space Mono
   ═══════════════════════════════════════════ */

:root {
  --bg: #f7f7f5;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eceae6;
  --surface-3: #e0ddd8;
  --text: #1a1a1a;
  --text-2: #6b6560;
  --text-3: #9a9590;
  --accent: #e06030;
  --accent-2: #c84f20;
  --accent-soft: #fdf0ea;
  --green: #2a9d5c;
  --green-soft: #e8f7ee;
  --yellow: #d4a017;
  --yellow-soft: #fef9e7;
  --red: #d44040;
  --red-soft: #fdeaea;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --font: 'DM Sans', -apple-system, sans-serif;
  --mono: 'Space Mono', monospace;
  --max-w: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --bg-2: #1a1918;
    --surface: #222120;
    --surface-2: #2e2d2b;
    --surface-3: #3d3b38;
    --text: #ede9e3;
    --text-2: #a09a92;
    --text-3: #706a62;
    --accent-soft: #2b1a10;
    --green-soft: #0f2518;
    --yellow-soft: #251f0a;
    --red-soft: #2a1010;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
  }
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
fieldset { border: none; margin-bottom: 1.5rem; }
legend { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.75rem; color: var(--text); }

/* ── Nav ───────────────────────────────── */
.nav { background: var(--surface); border-bottom: 1px solid var(--surface-2); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-logo { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 0.25rem; }
.nav-logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.3rem; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { padding: 0.4rem 0.75rem; border-radius: 6px; color: var(--text-2); font-size: 0.9rem; font-weight: 500; transition: background 0.15s; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-user { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; padding-left: 0.75rem; border-left: 1px solid var(--surface-2); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--text); cursor: pointer; }

@media (max-width: 700px) {
  .nav-links { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 0.75rem; border-bottom: 1px solid var(--surface-2); box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .nav-user { margin: 0; padding: 0; border: 0; }
  .nav-toggle { display: block; }
}

/* ── Buttons ───────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; background: var(--accent); color: #fff; font-weight: 600; font-size: 0.9rem; border: none; border-radius: var(--radius); cursor: pointer; transition: background 0.15s, transform 0.1s; }
.btn:hover { background: var(--accent-2); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-google { background: var(--surface); color: var(--text); border: 1.5px solid var(--surface-3); font-size: 1rem; padding: 0.75rem 1.5rem; }
.btn-google:hover { background: var(--surface-2); }
.btn-google svg { flex-shrink: 0; }

/* ── Page ──────────────────────────────── */
.main { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.page { padding: 2rem 0 3rem; }
.page-narrow { max-width: 640px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.6rem; }
.page-sub { color: var(--text-2); margin-top: 0.25rem; font-size: 0.95rem; }

/* ── Alerts ────────────────────────────── */
.alert { padding: 0.85rem 1.15rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.9rem; }
.alert-warn { background: var(--yellow-soft); border-left: 3px solid var(--yellow); }
.alert-ok { background: var(--green-soft); border-left: 3px solid var(--green); }
.alert-err { background: var(--red-soft); border-left: 3px solid var(--red); }
.alert a { font-weight: 600; }

/* ── Empty State ───────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-2); margin-bottom: 1.5rem; }
.empty-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Trip Grid ─────────────────────────── */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.trip-card { display: block; background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius-lg); padding: 1.25rem; transition: box-shadow 0.2s, transform 0.15s; }
.trip-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.trip-card-top { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.trip-role-badge { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; border-radius: 4px; }
.trip-role-badge.organizer { background: var(--accent-soft); color: var(--accent); }
.trip-role-badge.traveler { background: var(--surface-2); color: var(--text-2); }
.trip-status { font-size: 0.75rem; color: var(--text-3); text-transform: capitalize; }
.trip-card-name { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.35rem; }
.trip-card-dest, .trip-card-dates { font-size: 0.88rem; color: var(--text-2); }
.trip-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--surface-2); }
.trip-card-members { font-size: 0.82rem; color: var(--text-3); }
.trip-card-readiness { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--text-2); }

/* ── Bars ──────────────────────────────── */
.bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.4s ease; }
.bar-fill.warn { background: var(--yellow); }
.mini-bar { width: 60px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: var(--green); border-radius: 3px; }
.rbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.rbar-label { min-width: 80px; color: var(--text-2); text-transform: capitalize; }
.rbar-pct { min-width: 36px; text-align: right; font-family: var(--mono); font-size: 0.82rem; color: var(--text-2); }

/* ── Readiness Panel ───────────────────── */
.readiness-panel { display: flex; gap: 2rem; align-items: center; background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.readiness-ring-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.readiness-ring { width: 100%; height: 100%; }
.readiness-ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }
.readiness-cats { flex: 1; min-width: 200px; }
.readiness-cats h3 { font-size: 0.9rem; color: var(--text-2); margin-bottom: 0.75rem; }

/* ── Trip Columns ──────────────────────── */
.trip-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.trip-col h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.text-muted { color: var(--text-3); }

@media (max-width: 700px) {
  .trip-columns { grid-template-columns: 1fr; }
}

/* ── Checklist ─────────────────────────── */
.checklist { list-style: none; }
.checklist-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--surface-2); }
.check-btn { background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.check-box { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 2px solid var(--surface-3); border-radius: 6px; font-size: 0.85rem; font-weight: 700; color: transparent; transition: all 0.15s; }
.checklist-item.done .check-box { background: var(--green); border-color: var(--green); color: #fff; }
.check-info { flex: 1; }
.check-title { display: block; font-weight: 500; font-size: 0.95rem; }
.checklist-item.done .check-title { text-decoration: line-through; color: var(--text-3); }
.check-desc { display: block; font-size: 0.82rem; color: var(--text-3); margin-top: 0.15rem; }
.check-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: 3px; background: var(--surface-2); color: var(--text-3); margin-top: 0.3rem; display: inline-block; }
.check-req { font-size: 0.72rem; color: var(--accent); margin-left: 0.4rem; font-weight: 600; }

/* ── Badge Colors ──────────────────────── */
.badge-travel { background: #e0f0ff; color: #2060a0; }
.badge-documents { background: #fff0e0; color: #a06020; }
.badge-payment { background: #e0ffe0; color: #207020; }
.badge-health { background: #ffe0f0; color: #a02060; }
.badge-logistics { background: #f0e0ff; color: #6020a0; }
@media (prefers-color-scheme: dark) {
  .badge-travel { background: #1a2a3a; color: #6ab0e8; }
  .badge-documents { background: #2a2010; color: #d0a050; }
  .badge-payment { background: #102a10; color: #50c050; }
  .badge-health { background: #2a1020; color: #d060a0; }
  .badge-logistics { background: #201030; color: #a060d0; }
}

/* ── Members ───────────────────────────── */
.member-list { list-style: none; }
.member-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--surface-2); }
.member-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.member-avatar.placeholder { background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-2); font-size: 0.9rem; }
.member-info { flex: 1; }
.member-name { display: block; font-weight: 500; font-size: 0.95rem; }
.member-role { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.member-role.organizer { color: var(--accent); }
.member-progress { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-3); font-family: var(--mono); }

/* ── Invite Box ────────────────────────── */
.invite-box { display: flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius); padding: 0.4rem 0.6rem; }
.invite-label { font-size: 0.78rem; color: var(--text-3); }
.invite-code { font-family: var(--mono); font-size: 0.88rem; letter-spacing: 0.04em; background: var(--surface-2); padding: 0.2rem 0.5rem; border-radius: 4px; }

/* ── Forms ──────────────────────────────── */
.form { margin-top: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text-2); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.6rem 0.85rem; font-family: var(--font); font-size: 0.95rem;
  background: var(--bg); border: 1.5px solid var(--surface-3); border-radius: var(--radius);
  color: var(--text); transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── Auth Page ─────────────────────────── */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 2rem 0; }
.auth-card { text-align: center; max-width: 380px; width: 100%; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.auth-sub { color: var(--text-2); margin-bottom: 2rem; }
.auth-terms { font-size: 0.78rem; color: var(--text-3); margin-top: 1.5rem; }

/* ── Hero ──────────────────────────────── */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding: 4rem 0 3rem; min-height: 70vh; }
.hero-title { font-size: 2.8rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.hero-sub { font-size: 1.12rem; color: var(--text-2); margin: 1.25rem 0 2rem; line-height: 1.6; max-width: 480px; }
.hero-note { font-size: 0.82rem; color: var(--text-3); margin-top: 0.75rem; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 2.5rem 0; }
  .hero-title { font-size: 2rem; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-visual { max-width: 360px; margin: 0 auto; }
}

/* ── Readiness Card (hero) ─────────────── */
.readiness-card { background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-lg); }
.readiness-header { font-weight: 600; font-size: 0.9rem; color: var(--text-2); margin-bottom: 0.5rem; }
.readiness-score { font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 1.25rem; }
.readiness-bars { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Features ──────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; padding: 2rem 0 4rem; border-top: 1px solid var(--surface-2); }
.feature { padding: 1.25rem; }
.feature-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.feature p { font-size: 0.9rem; color: var(--text-2); line-height: 1.5; }

/* ── Footer ────────────────────────────── */
.footer { text-align: center; padding: 2rem 1.25rem; font-size: 0.82rem; color: var(--text-3); border-top: 1px solid var(--surface-2); }

/* ── Auth Form Additions ───────────────── */
.btn-full { width: 100%; justify-content: center; }
.auth-form { text-align: left; }
.auth-form .form-group { margin-bottom: 1rem; }
.auth-switch { font-size: 0.88rem; color: var(--text-2); margin-top: 1.5rem; }
.auth-switch a { font-weight: 600; }
.nav-avatar-init { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.82rem; flex-shrink: 0; }
.nav-links-public { display: flex; align-items: center; gap: 0.75rem; }
