/* === QuitPulse Global Styles === */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

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

:root {
  --bg-deep: #0a0a0f;
  --bg-card: #111118;
  --bg-surface: #1a1a24;
  --bg-input: #16161f;
  --text-primary: #f0ede6;
  --text-secondary: #9890a8;
  --text-dim: #6b6480;
  --accent: #e8a44a;
  --accent-dim: #c4863a;
  --accent-glow: rgba(232, 164, 74, 0.12);
  --green-soft: #5ccc8a;
  --green-dim: rgba(92, 204, 138, 0.12);
  --red-soft: #e85d5d;
  --red-dim: rgba(232, 93, 93, 0.12);
  --blue-soft: #5c9fcc;
  --border: #252530;
  --radius: 12px;
  --radius-lg: 20px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

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

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--bg-deep);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232, 164, 74, 0.25);
  color: var(--bg-deep);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}

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

.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* === FORM ELEMENTS === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-dim);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239890a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-sm { padding: 20px; border-radius: var(--radius); }

/* === LAYOUT === */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* === NAV === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.nav-scrolled {
  border-bottom-color: var(--border);
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

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

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

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(232, 164, 74, 0.2);
}

.badge-green {
  background: var(--green-dim);
  color: var(--green-soft);
  border: 1px solid rgba(92, 204, 138, 0.2);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red-soft);
  border: 1px solid rgba(232, 93, 93, 0.2);
}

/* === PROGRESS BAR === */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-surface);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green-soft));
  border-radius: 100px;
  transition: width 0.5s ease;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  max-width: 400px;
}

.toast-success { background: var(--green-soft); color: var(--bg-deep); }
.toast-error { background: var(--red-soft); color: white; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === MESSAGE BUBBLE === */
.message-bubble {
  padding: 16px 18px;
  border-radius: 18px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 480px;
  position: relative;
}

.message-incoming {
  background: var(--bg-surface);
  border-bottom-left-radius: 6px;
}

.message-accent {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: var(--bg-deep);
  border-bottom-left-radius: 6px;
}

.message-time {
  font-size: 0.72rem;
  margin-top: 8px;
  opacity: 0.6;
}

.message-trigger {
  font-size: 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* === STAT CARD === */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* === MILESTONE === */
.milestone {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.milestone:last-child { border-bottom: none; }

.milestone-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.milestone-achieved .milestone-dot {
  background: var(--green-dim);
  color: var(--green-soft);
}

.milestone-pending .milestone-dot {
  background: var(--bg-surface);
  color: var(--text-dim);
}

.milestone-current .milestone-dot {
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.milestone-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.milestone-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.milestone-achieved .milestone-info h4 { color: var(--green-soft); }
.milestone-pending .milestone-info h4 { color: var(--text-dim); }

/* === LOADING === */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg-surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s;
}

.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tab:hover:not(.active) { color: var(--text-primary); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* === MOBILE === */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .container { padding: 0 16px; }
  .card { padding: 20px; }
  .nav { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .tabs { flex-wrap: wrap; border-radius: var(--radius); }
  .tab { flex: 1; min-width: 80px; text-align: center; }
}
