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

:root {
  --bg: #0d0d0f;
  --surface: #18181b;
  --surface2: #222226;
  --surface3: #2a2a30;
  --accent: #d4a8b8;
  --accent-dark: #b8899c;
  --accent-glow: rgba(212, 168, 184, 0.15);
  --gold: #c9a84c;
  --gold-glow: rgba(201, 168, 76, 0.12);
  --text: #f5f0f3;
  --text-muted: #8a8490;
  --text-faint: #4a4650;
  --success: #7ec8a0;
  --warning: #e07070;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
}

label, .label {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--text);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--bg);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-queen {
  background: linear-gradient(135deg, #c9a84c, #e8c97a);
  color: #1a1200;
  font-weight: 600;
}
.btn-queen:hover {
  box-shadow: 0 0 20px var(--gold-glow);
  color: #1a1200;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---- INPUTS ---- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(212, 168, 184, 0.5);
}

/* ---- CREDIT PILL ---- */
.credit-pill {
  background: var(--surface2);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.credit-pill.queen {
  color: var(--gold);
}

.credit-pill.empty {
  color: var(--warning);
  animation: pulse-warning 1.5s ease infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---- SKELETON ---- */
.skeleton {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.2s ease infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  transform: translateY(12px);
  transition: transform 200ms ease;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  transition: color 150ms;
}
.modal-close:hover { color: var(--text); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.badge-warning {
  background: rgba(224, 112, 112, 0.12);
  color: var(--warning);
  border: 1px solid rgba(224, 112, 112, 0.2);
}

.badge-success {
  background: rgba(126, 200, 160, 0.12);
  color: var(--success);
  border: 1px solid rgba(126, 200, 160, 0.2);
}

.badge-queen {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.badge-free {
  background: rgba(212, 168, 184, 0.1);
  color: var(--accent);
  border: 1px solid rgba(212, 168, 184, 0.15);
}

.badge-budget {
  background: rgba(126, 200, 160, 0.1);
  color: var(--success);
  font-size: 10px;
  padding: 2px 8px;
}

.badge-premium {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
  font-size: 10px;
  padding: 2px 8px;
}

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

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

/* ---- NAV ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- TOAST / NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  min-width: 240px;
  animation: toast-in 200ms ease;
}

.toast.success { border-color: rgba(126, 200, 160, 0.3); color: var(--success); }
.toast.error { border-color: rgba(224, 112, 112, 0.3); color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- UTILITY ---- */
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.hidden { display: none !important; }

/* ---- TOGGLE BUTTON ACTIVE STATES ---- */
.skin-type-btn.active,
.allergen-checkbox.active {
  background: var(--accent-glow) !important;
  border-color: rgba(212, 168, 184, 0.4) !important;
  color: var(--accent) !important;
}

/* ---- LOADING STAGES ---- */
.loading-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.loading-stage.done {
  color: var(--success);
  border-color: rgba(126,200,160,0.2);
}

.loading-stage.active {
  color: var(--accent);
  border-color: rgba(212,168,184,0.2);
}

.stage-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.loading-stage.active .stage-icon {
  border-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.loading-stage.done .stage-icon::after {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  border: none;
}

.loading-stage.done .stage-icon {
  border-color: var(--success);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
}
