/* ============================================
   MANDATIFY APP — Shared Design System
   Harvey.ai aesthetic · Dark-first
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600&display=swap');

/* --- Tokens --- */
:root {
  --bg:          #0A0A09;
  --surface:     #121210;
  --surface-2:   #191816;
  --surface-3:   #211F1C;
  --border:      rgba(255,255,255,0.08);
  --border-hover:rgba(184,150,62,0.35);
  --gold:        #B8963E;
  --gold-hover:  #CCA84A;
  --gold-faint:  rgba(184,150,62,0.10);
  --gold-faint2: rgba(184,150,62,0.18);
  --text:        #EDEAE2;
  --text-muted:  #9A9690;
  --text-faint:  #5A5754;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --transition:  0.2s ease;
}

[data-theme="light"] {
  --bg:          #F5F2EA;
  --surface:     #EDEAE0;
  --surface-2:   #E5E1D6;
  --surface-3:   #DDD9CE;
  --border:      rgba(0,0,0,0.08);
  --border-hover:rgba(158,124,40,0.4);
  --gold:        #9E7C28;
  --gold-hover:  #B8963E;
  --gold-faint:  rgba(158,124,40,0.10);
  --gold-faint2: rgba(158,124,40,0.18);
  --text:        #1A1816;
  --text-muted:  #5A5754;
  --text-faint:  #9A9690;
  --shadow:      0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.15);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

/* --- Typography --- */
.serif { font-family: 'Instrument Serif', serif; }
h1, h2, h3 { line-height: 1.2; }

/* --- Layout --- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,9,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center;
  transition: background var(--transition);
}
[data-theme="light"] .nav { background: rgba(245,242,234,0.88); }
.nav__inner {
  max-width: 1140px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__logo {
  font-family: 'Instrument Serif', serif;
  font-size: 20px; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 4px;
}
.nav__logo .m-accent { color: var(--gold); }
.nav__actions { display: flex; align-items: center; gap: 12px; }
.nav__theme {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 15px;
  transition: all var(--transition);
}
.nav__theme:hover { border-color: var(--border-hover); color: var(--gold); }
.nav__back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  transition: color var(--transition);
}
.nav__back:hover { color: var(--gold); }
.nav__back svg { width: 16px; height: 16px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--gold); color: #0A0A09;
}
.btn--primary:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn--outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn--outline:hover { border-color: var(--border-hover); color: var(--gold); }
.btn--ghost {
  background: transparent; color: var(--text-muted);
  border: none; padding: 8px 12px;
}
.btn--ghost:hover { color: var(--text); }
.btn--sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn--lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn--full { width: 100%; }
.btn--register {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px; font-size: 13px; border-radius: var(--radius-md);
}
.btn--register:hover { border-color: var(--gold); color: var(--gold); }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.card--elevated { background: var(--surface-2); }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--gold { background: var(--gold-faint); color: var(--gold); border: 1px solid rgba(184,150,62,0.2); }
.badge--green { background: rgba(52,199,89,0.1); color: #34C759; border: 1px solid rgba(52,199,89,0.2); }
.badge--muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* --- Stars --- */
.stars { display: flex; align-items: center; gap: 2px; }
.star { font-size: 13px; }
.star--full { color: var(--gold); }
.star--empty { color: var(--text-faint); }
.rating-score { font-size: 14px; font-weight: 600; color: var(--text); margin-left: 4px; }
.rating-count { font-size: 12px; color: var(--text-muted); }

/* --- Avatar --- */
.avatar {
  border-radius: 50%; background: var(--gold-faint);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  color: var(--gold); font-weight: 400; flex-shrink: 0;
  border: 2px solid var(--gold-faint2);
}
.avatar--sm  { width: 40px;  height: 40px;  font-size: 16px; }
.avatar--md  { width: 56px;  height: 56px;  font-size: 22px; }
.avatar--lg  { width: 80px;  height: 80px;  font-size: 32px; }
.avatar--xl  { width: 100px; height: 100px; font-size: 40px; }

/* --- Tags / Chips --- */
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 100px;
  font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.chip:hover, .chip.active {
  background: var(--gold-faint); color: var(--gold);
  border-color: rgba(184,150,62,0.3);
}

/* --- Tag row --- */
.tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* --- Section label --- */
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
}

/* --- Divider --- */
.divider { height: 1px; background: var(--border); }

/* --- Search bar --- */
.search-bar {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--border-hover); }
.search-bar__field {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; flex: 1;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.search-bar__field:last-of-type { border-right: none; }
.search-bar__icon { color: var(--text-faint); flex-shrink: 0; }
.search-bar__input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit;
  font-size: 15px; width: 100%;
}
.search-bar__input::placeholder { color: var(--text-faint); }
.search-bar__input::-webkit-input-placeholder { color: var(--text-faint); }
.search-bar__btn {
  margin: 6px; padding: 10px 20px;
  background: var(--gold); color: #0A0A09;
  border: none; border-radius: calc(var(--radius-xl) - 4px);
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.search-bar__btn:hover { background: var(--gold-hover); }

/* --- Verified checkmark --- */
.verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: #0A0A09;
  font-size: 10px; flex-shrink: 0;
}

/* --- Price tag --- */
.price {
  font-family: 'Instrument Serif', serif;
  font-size: 22px; color: var(--text);
}
.price span { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text-muted); }

/* --- Slot grid --- */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.slot {
  padding: 8px 6px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); text-align: center;
  cursor: pointer; transition: all var(--transition);
}
.slot:hover { border-color: var(--border-hover); color: var(--text); }
.slot.selected {
  background: var(--gold-faint); border-color: var(--gold);
  color: var(--gold); font-weight: 500;
}
.slot.unavailable {
  opacity: 0.35; cursor: not-allowed;
  text-decoration: line-through;
}

/* --- Progress steps --- */
.steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 40px;
}
.step {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.step:last-child { flex: 0; }
.step__dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface); color: var(--text-faint);
  transition: all var(--transition);
}
.step.active .step__dot { border-color: var(--gold); background: var(--gold-faint); color: var(--gold); }
.step.done .step__dot { border-color: var(--gold); background: var(--gold); color: #0A0A09; }
.step__label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.step.active .step__label { color: var(--text); font-weight: 500; }
.step__line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.step.done + .step .step__line { background: var(--gold); }

/* --- Form inputs --- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-input, .form-textarea, .form-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  color: var(--text); font-family: inherit; font-size: 15px;
  outline: none; transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--border-hover); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
.form-textarea { resize: vertical; min-height: 120px; }

/* --- Review card --- */
.review {
  padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.review__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.review__author { font-size: 14px; font-weight: 500; }
.review__date { font-size: 12px; color: var(--text-faint); }
.review__text { font-size: 14px; color: var(--text-muted); line-height: 1.6; font-style: italic; }
.review__text::before { content: '„'; }
.review__text::after { content: '"'; }

/* --- Stat card --- */
.stat-card {
  padding: 20px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  text-align: center;
}
.stat-card__value {
  font-family: 'Instrument Serif', serif;
  font-size: 32px; color: var(--gold); line-height: 1;
  margin-bottom: 6px;
}
.stat-card__label { font-size: 12px; color: var(--text-muted); }

/* --- Success screen --- */
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(52,199,89,0.12); border: 2px solid rgba(52,199,89,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 24px;
}

/* --- Skeleton loader --- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* --- Scroll animations --- */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* --- Toast notification --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 20px;
  font-size: 14px; color: var(--text); white-space: nowrap;
  box-shadow: var(--shadow-lg); z-index: 9999;
  opacity: 0; transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container, .container--narrow { padding: 0 16px; }
  .search-bar { flex-direction: column; border-radius: var(--radius-lg); }
  .search-bar__field { border-right: none; border-bottom: 1px solid var(--border); width: 100%; }
  .search-bar__btn { margin: 8px; width: calc(100% - 16px); }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
