:root {
  --primary: #1f3fe0;
  --primary-dark: #142b9e;
  --primary-light: #e8ecfd;
  --navy: #1e2433;
  --navy-2: #262e42;
  --bg: #eef0f4;
  --card: #ffffff;
  --border: #e0e3ea;
  --text: #232733;
  --text-muted: #676d7a;
  --success: #1c8a4b;
  --success-bg: #e3f6ea;
  --danger: #d6334c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.06), 0 1px 6px rgba(20, 24, 40, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

img { max-width: 100%; display: block; }

button, input, select, textarea { font-family: inherit; font-size: 14px; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f4f5f8; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fdeeef; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Site header (marketing pages) ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #6d8bff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: var(--text); font-weight: 500; font-size: 14.5px; }
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1100px 420px at 15% -10%, #dbe4ff 0%, transparent 60%), linear-gradient(180deg, #f6f8ff 0%, var(--bg) 100%);
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--border);
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.5px; }
.hero p.lead { font-size: 17px; color: var(--text-muted); margin: 0 0 28px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 36px; }
.hero-stats div strong { display: block; font-size: 24px; color: var(--primary-dark); }
.hero-stats div span { font-size: 13px; color: var(--text-muted); }

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.hero-card .mini-profile { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.hero-card .avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#ffb35c,#ff7676); display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:20px; }
.hero-card .mini-profile h4 { margin: 0 0 2px; font-size: 15.5px; }
.hero-card .mini-profile span { font-size: 13px; color: var(--text-muted); }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.hero-card .rating { display:flex; align-items:center; gap:6px; font-size: 13px; color: var(--text-muted); }
.hero-card .rating strong { color: var(--text); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.section-head h2 { font-size: 30px; margin: 0 0 12px; letter-spacing: -0.3px; }
.section-head p { color: var(--text-muted); font-size: 15.5px; margin: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 16.5px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

.steps { counter-reset: step; }
.step-card { position: relative; padding-left: 8px; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 15px;
}

.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.cta-banner {
  background: linear-gradient(135deg, var(--primary), #4a63e8 60%, #6d8bff);
  border-radius: 18px;
  padding: 48px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-banner h2 { margin: 0 0 8px; font-size: 26px; }
.cta-banner p { margin: 0; opacity: .9; }
.cta-banner .btn-primary { background: #fff; color: var(--primary-dark); }
.cta-banner .btn-primary:hover { background: #eef1ff; }

.site-footer { background: var(--navy); color: #c6cadb; padding: 48px 0 24px; margin-top: 40px; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 14px; }
.site-footer a { color: #c6cadb; font-size: 13.5px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer .foot-brand p { font-size: 13.5px; color: #9aa0b5; max-width: 280px; }
.foot-bottom { border-top: 1px solid #333c54; margin-top: 32px; padding-top: 20px; text-align: center; font-size: 12.5px; color: #838aa3; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(900px 400px at 50% -10%, #dbe4ff 0%, transparent 60%), var(--bg);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  padding: 36px;
}
.auth-card.auth-wide { max-width: 640px; }
.auth-card.auth-narrow { max-width: 420px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 24px; margin: 0 0 6px; }
.auth-head p { color: var(--text-muted); font-size: 14px; margin: 0; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .req { color: var(--danger); }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=tel],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-muted); }
.checkbox-row input { margin-top: 3px; }

.form-error, .form-success {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: none;
}
.form-error { background: #fdeeef; color: var(--danger); border: 1px solid #f6cdd3; }
.form-success { background: var(--success-bg); color: var(--success); border: 1px solid #bfe6cd; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field.invalid .field-error { display: block; }

.divider-line { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12.5px; margin: 20px 0; }
.divider-line::before, .divider-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- App shell (dashboard) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 240px;
  background: var(--navy);
  color: #cfd3e2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.app-sidebar .brand { color: #fff; padding: 20px 20px 16px; border-bottom: 1px solid #323a51; }
.app-sidebar .brand small { color: #9aa0b8; }
.side-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px; color: #cfd3e2;
  font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.side-nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.side-nav a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav .nav-label { text-transform: uppercase; font-size: 11px; letter-spacing: .5px; color: #7d84a0; padding: 14px 12px 6px; }
.sidebar-foot { padding: 14px; border-top: 1px solid #323a51; }
.sidebar-foot a { display: flex; align-items: center; gap: 10px; color: #cfd3e2; font-size: 14px; padding: 8px 8px; border-radius: 8px; }
.sidebar-foot a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }

.app-main { flex: 1; min-width: 0; }
.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.app-topbar h1 { font-size: 18px; margin: 0; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-muted); }
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6d8bff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; overflow: hidden; flex-shrink: 0;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.app-content { padding: 28px; max-width: 980px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 16px; margin: 0; }
.card-head p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.card-body { padding: 22px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 22px; background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.tab-btn {
  background: none; border: none; padding: 13px 14px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.profile-photo-row { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.avatar-xl {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6d8bff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 30px; overflow: hidden; flex-shrink: 0; border: 3px solid var(--primary-light);
}
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; padding-left: 18px; }
.upload-hint li { margin-bottom: 2px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.gallery-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1/1; background: #f0f1f5; border: 1px solid var(--border); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item button {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,20,30,.65); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
}
.gallery-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--border); border-radius: 8px; aspect-ratio: 1/1; cursor: pointer;
  color: var(--text-muted); font-size: 12px; background: #fafbfd;
}
.gallery-add:hover { border-color: var(--primary); color: var(--primary); }

.chip-input { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 600; padding: 5px 6px 5px 10px; border-radius: 999px;
}
.chip button { background: none; border: none; color: var(--primary-dark); cursor: pointer; font-size: 13px; padding: 0 2px; }
.field .chip-input input[type=text] {
  border: none; outline: none; box-shadow: none; flex: 1;
  min-width: 120px; width: auto; padding: 5px; background: transparent;
}

.tour-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tour-item h4 { margin: 0 0 4px; font-size: 14.5px; }
.tour-item p { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.tour-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-muted); }
.tour-meta strong { color: var(--text); }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state .feature-icon { margin: 0 auto 12px; }

.status-pill { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.status-complete { background: var(--success-bg); color: var(--success); }
.status-incomplete { background: #fdf3e0; color: #9a6b0a; }

.progress-track { height: 8px; background: #e8eaf0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card span { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat-card strong { display: block; font-size: 26px; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff;
  padding: 13px 18px; border-radius: 9px; font-size: 13.5px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; transform: translateY(20px); opacity: 0;
  transition: all .25s; pointer-events: none; z-index: 100;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.toast-error { background: var(--danger); }

/* ---------- Directory (guides.html) ---------- */
.directory-toolbar { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.directory-toolbar input, .directory-toolbar select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.directory-toolbar input { flex: 1; min-width: 220px; }
.guide-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; height: 100%;
}
.guide-card .mini-profile { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.guide-card h3 { margin: 0 0 2px; font-size: 15.5px; }
.guide-card .loc { font-size: 13px; color: var(--text-muted); }
.guide-card p.bio { font-size: 13.5px; color: var(--text-muted); margin: 0 0 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.guide-card .badge-row { margin-bottom: 14px; }

.public-header { background: linear-gradient(135deg, var(--primary), #4a63e8 60%, #6d8bff); color: #fff; padding: 40px 0; }
.public-header .mini-profile { display: flex; gap: 20px; align-items: center; }
.public-header h1 { margin: 0 0 6px; font-size: 26px; }
.public-header .loc { color: #dbe2ff; font-size: 14.5px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-0 { margin-bottom: 0 !important; }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .app-sidebar { position: fixed; left: -260px; z-index: 60; transition: left .2s; box-shadow: 0 0 0 100vw rgba(0,0,0,0); }
  .app-sidebar.open { left: 0; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
  .field-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-nav, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: flex; }
  .site-header .container { padding: 0 16px; gap: 12px; }
  .brand { font-size: 16px; min-width: 0; }
  .brand small { display: none; }
  .brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero h1 { font-size: 30px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; }
  .app-content { padding: 18px; }
  .app-topbar { padding: 0 16px; }
  #topbar-name { display: none; }
  .tabs { overflow-x: auto; }
  .profile-photo-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .card-head { flex-wrap: wrap; gap: 12px; }
  .tour-item { flex-direction: column; }
  .tour-meta { flex-wrap: wrap; }
  .public-header .mini-profile { flex-direction: column; text-align: center; }
}
