:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe8;
  --text: #1f1b16;
  --text-muted: #857c6f;
  --border: #eae4da;
  --primary: #c9622a;
  --primary-dark: #a94f1f;
  --primary-light: #fdece0;
  --accent: #2f7a5f;
  --danger: #c94141;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(31, 27, 22, 0.06);
  --shadow: 0 8px 24px rgba(31, 27, 22, 0.08);
  --shadow-lg: 0 16px 40px rgba(31, 27, 22, 0.14);
  --header-h: 64px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0 0 8px; color: var(--text-muted); }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.main-nav__link:hover { background: var(--surface-2); color: var(--text); }
.main-nav__link.is-active { background: var(--primary-light); color: var(--primary-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  font-size: 1.1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { border-color: var(--border); }

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
  line-height: 1.1;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }

.btn--ghost { background: var(--surface-2); color: var(--text); }
.btn--ghost:hover { background: var(--border); }

.btn--outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn--outline:hover { background: var(--surface-2); }

.btn--danger { background: #fde7e7; color: var(--danger); }
.btn--danger:hover { background: #f9caca; }

.btn--sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--text); }

.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input--code {
  text-align: center;
  letter-spacing: 0.6em;
  font-size: 1.6rem;
  font-weight: 700;
  padding-left: 0.6em;
}
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: 0.8rem; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.radio-cards input { position: absolute; opacity: 0; }
.radio-cards label {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-weight: 600; font-size: 0.85rem; cursor: pointer; text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.radio-cards input:checked + label { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Cards / Surfaces ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.auth-shell {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  text-align: center;
}
.auth-card .brand__mark { margin: 0 auto 16px; width: 52px; height: 52px; font-size: 1.6rem; border-radius: 16px; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card p { margin-bottom: 24px; }
.auth-card form { text-align: left; }

.otp-phone { display: inline-block; padding: 4px 10px; background: var(--surface-2); border-radius: 8px; font-weight: 700; }

/* ---------- Messages ---------- */

.messages { list-style: none; margin: 16px auto 0; padding: 0; max-width: 1180px; padding: 0 20px; }
.messages li {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
  background: var(--surface-2); font-size: 0.9rem; font-weight: 600;
  border-left: 4px solid var(--primary);
}
.messages li.success { border-color: var(--accent); }
.messages li.error { border-color: var(--danger); }
.messages li.warning { border-color: #d9a441; }

/* ---------- Utility ---------- */

.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state__icon { font-size: 2.6rem; margin-bottom: 12px; }

@media (max-width: 720px) {
  :root { font-size: 15px; }
  .container { padding: 0 14px; }
  .brand span.brand__text { display: none; }
}
