:root {
  --gold: #C9A96E;
  --gold-light: #E8D5A8;
  --sage: #7A9E7E;
  --sage-light: #A8C5AB;
  --cream: #FAF7F2;
  --bordeaux: #8B3A52;
  --bordeaux-light: #B85A72;
  --text: #3A3A3A;
  --text-light: #6B6B6B;
  --shadow: rgba(0,0,0,0.08);
  --radius: 16px;
  --nav-height: 70px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

/* Geometric pattern background */
.geometric-pattern {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 220px;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A96E'%3E%3Cpath d='M30 0l30 30-30 30L0 30z' opacity='.4'/%3E%3Cpath d='M30 10l20 20-20 20-20-20z' opacity='.3'/%3E%3Cpath d='M30 20l10 10-10 10-10-10z' opacity='.2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
}

/* Pages */
.page {
  display: none;
  padding-bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom));
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.page-content {
  padding: 24px 20px;
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
  word-break: break-word;
}

/* Hide navbar when keyboard is open */
.keyboard-open .bottom-nav {
  display: none !important;
}

/* Typography */
.app-title {
  font-family: 'Amiri', serif;
  font-size: 56px;
  color: var(--gold);
  text-align: center;
  margin-top: 30px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(201,169,110,0.2);
}
.app-title-latin {
  font-family: 'Nunito', sans-serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.app-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
  margin-top: 4px;
  font-weight: 600;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 20px;
}

/* Confidence score */
.confidence-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  text-align: center;
}
.confidence-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
}
.confidence-ring {
  width: 100%;
  height: 100%;
}
#confidence-circle {
  transition: stroke-dashoffset 1s ease;
}
.confidence-score-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.confidence-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.confidence-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.confidence-level {
  font-size: 15px;
  font-weight: 700;
  color: var(--bordeaux);
  margin-top: 4px;
}

/* Welcome card */
.welcome-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  border-left: 4px solid var(--gold);
}
.greeting {
  font-size: 18px;
  font-weight: 700;
  color: var(--bordeaux);
  margin-bottom: 16px;
}
.daily-verse {
  font-family: 'Amiri', serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}
.daily-verse .verse-arabic {
  display: block;
  font-size: 22px;
  text-align: right;
  direction: rtl;
  color: var(--gold);
  margin-bottom: 8px;
  line-height: 1.6;
}
.daily-verse .verse-french {
  display: block;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 6px;
}
.daily-verse .verse-ref {
  display: block;
  font-size: 13px;
  color: var(--sage);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(201,169,110,0.3);
  margin-top: 20px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201,169,110,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-light);
  border: 2px solid #e0d8cc;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-small { width: auto; padding: 10px 20px; font-size: 14px; margin-top: 0; }

.btn-icon { font-size: 18px; }

/* AI message */
.ai-message {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 4px 20px var(--shadow);
  border-left: 4px solid var(--sage);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  animation: slideUp 0.5s ease;
  overflow: hidden;
  word-break: break-word;
}
.ai-message .source-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--sage-light);
  color: white;
  font-weight: 700;
  margin-top: 12px;
}

/* Loading dots */
.loading-dots { display: inline-flex; gap: 4px; padding: 8px 0; }
.loading-dots span {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Form */
.form-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 20px var(--shadow);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--bordeaux);
  margin-bottom: 8px;
}
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e2d8;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.2s;
  resize: vertical;
}
.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}

/* Mood slider */
.emoji-slider { text-align: center; }
.emoji-slider input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--bordeaux-light), var(--gold), var(--sage));
  outline: none;
  margin: 12px 0;
}
.emoji-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow);
}
.mood-faces {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}
.mood-face {
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.4;
}
.mood-face.active { transform: scale(1.3); opacity: 1; }
.mood-text {
  font-weight: 700;
  color: var(--gold);
  font-size: 15px;
  margin-top: 4px;
}

/* Dashboard icons */
.dash-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: var(--gold);
}
.dash-icon svg { width: 28px; height: 28px; }

/* Trophy icons */
.trophy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.trophy-icon svg { width: 36px; height: 36px; }

/* Goals */
.goals-list { margin-top: 16px; }
.goal-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px var(--shadow);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}
.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.goal-title {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
}
.goal-category {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  color: white;
}
.cat-deen { background: var(--sage); }
.cat-sante { background: #E07A5F; }
.cat-etudes { background: #5B8FB9; }
.cat-travail { background: var(--gold); }
.cat-personnel { background: var(--bordeaux); }

.goal-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.goal-date {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #e8e2d8;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 700;
  text-align: right;
}

/* Subtasks */
.subtask-list { margin: 10px 0; }
.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ece4;
  font-size: 14px;
}
.subtask-item:last-child { border-bottom: none; }
.subtask-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--sage);
  cursor: pointer;
}
.subtask-item.done span { text-decoration: line-through; color: var(--text-light); }

.goal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.goal-actions button {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-accomplish { background: var(--sage-light); color: white; }
.btn-accomplish:hover { background: var(--sage); }
.btn-status { background: #e8e2d8; color: var(--text); }
.btn-status:hover { background: var(--gold-light); }
.btn-delete { background: #f0e0e0; color: var(--bordeaux); }
.btn-delete:hover { background: #e8c8c8; }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-content h3 {
  font-size: 20px;
  color: var(--bordeaux);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}
#subtasks-container .subtask-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
#subtasks-container .subtask-input input {
  flex: 1;
}
#subtasks-container .subtask-input button {
  background: var(--bordeaux-light);
  color: white;
  border: none;
  border-radius: 8px;
  width: 32px;
  cursor: pointer;
  font-size: 16px;
}

/* Trophies */
.trophies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.trophy-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.2s;
}
.trophy-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.trophy-card.unlocked {
  animation: pulse 0.5s ease;
}
.trophy-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--bordeaux);
  margin-bottom: 4px;
}
.trophy-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}
.trophy-date {
  font-size: 11px;
  color: var(--sage);
  font-weight: 700;
  margin-top: 6px;
}

/* Citations */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.filter-btn {
  padding: 8px 16px;
  border: 2px solid #e8e2d8;
  border-radius: 20px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  color: var(--text-light);
}
.filter-btn.active { background: var(--gold); color: white; border-color: var(--gold); }

.citation-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px var(--shadow);
  position: relative;
  overflow: hidden;
}
.citation-text {
  font-family: 'Amiri', serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 8px;
}
.citation-text .arabic {
  display: block;
  text-align: right;
  direction: rtl;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 6px;
}
.citation-source {
  font-size: 13px;
  color: var(--sage);
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}
.citation-category-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gold-light);
  color: var(--text);
  font-weight: 700;
  margin-top: 8px;
}
.citation-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.citation-actions button {
  padding: 6px 14px;
  border: 2px solid #e8e2d8;
  border-radius: 8px;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
}
.citation-actions button:hover { border-color: var(--gold); color: var(--gold); }
.citation-actions button.fav-active { background: var(--gold); color: white; border-color: var(--gold); }

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.dash-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 16px var(--shadow);
}
.dash-label { font-size: 12px; color: var(--text-light); font-weight: 700; margin-bottom: 8px; }
.dash-value { font-size: 22px; font-weight: 800; color: var(--bordeaux); }
.dash-value.streak { color: var(--gold); }

.mood-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 50px;
  padding-top: 6px;
}
.mood-bar {
  width: 12px;
  border-radius: 4px 4px 0 0;
  background: var(--gold-light);
  transition: height 0.3s;
}

/* Dashboard completed goals */
.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--bordeaux);
  margin: 20px 0 12px;
}
.dash-goal-item {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-goal-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 14px;
}
.dash-goal-info {
  flex: 1;
  min-width: 0;
}
.dash-goal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-goal-progress-bar {
  height: 6px;
  background: #e8e2d8;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.dash-goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.dash-goal-percent {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}
.dash-no-goals {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 16px 0;
}

.encouragement-card {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 20px rgba(201,169,110,0.3);
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: white;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -4px 20px var(--shadow);
  border-radius: 20px 20px 0 0;
  z-index: 1000;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  will-change: transform;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  flex: 1;
  min-width: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-light);
}
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.nav-icon svg { width: 22px; height: 22px; }
.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nav-btn.active { color: var(--gold); }
.nav-btn.active .nav-label { color: var(--gold); }
.nav-btn.active .nav-icon svg { stroke: var(--gold); }

/* ============== Onboarding ============== */
.onboarding-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: 40px 24px;
}
.onboarding-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(201,169,110,0.25);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.onboarding-brand {
  font-size: 18px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 32px;
}
.onboarding-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 8px;
}
.onboarding-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.5;
}
/* ============== Auth tabs ============== */
.auth-tabs {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px var(--shadow);
  width: 100%;
  max-width: 320px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: white;
  box-shadow: 0 2px 8px rgba(201,169,110,0.3);
}
.auth-form {
  width: 100%;
  max-width: 320px;
  animation: fadeIn 0.3s ease;
}
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-input {
  width: 100%;
  max-width: 100%;
  padding: 14px 18px;
  border: 2px solid #e8e2d8;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
}
.auth-input:focus {
  outline: none;
  border-color: var(--gold);
}
.auth-input.error {
  border-color: var(--bordeaux);
}
.onboarding-error {
  color: var(--bordeaux);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
}

/* ============== Tutoriel iPhone ============== */
.tuto-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: 40px 24px;
  position: relative;
}
.tuto-skip {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s;
}
.tuto-skip:hover { color: var(--gold); }
.tuto-step {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tuto-step.active { display: block; }
.tuto-illustration {
  margin: 0 auto 24px;
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--shadow);
}
.tuto-illustration svg { width: 48px; height: 48px; }
.tuto-step-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 12px;
}
.tuto-step-text {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}
.tuto-dots {
  display: flex;
  gap: 10px;
  margin: 32px 0 24px;
}
.tuto-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0d8cc;
  transition: background 0.2s, transform 0.2s;
}
.tuto-dot.active {
  background: var(--gold);
  transform: scale(1.2);
}
.tuto-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============== Settings ============== */
.settings-btn {
  position: absolute;
  top: 24px;
  right: 20px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--shadow);
  z-index: 10;
  color: var(--text-light);
  transition: color 0.2s, box-shadow 0.2s;
}
.settings-btn:hover { color: var(--gold); box-shadow: 0 4px 16px var(--shadow); }
.settings-modal { max-width: 360px; }
.settings-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0ece4;
}
.settings-item:last-child { border-bottom: none; }
.settings-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  display: block;
}
.settings-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--bordeaux);
  margin-bottom: 8px;
}
.settings-rename {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0ece4;
}
.settings-rename .auth-input { text-align: left; }
.btn-danger {
  padding: 12px 20px;
  background: var(--bordeaux);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: var(--bordeaux-light); }

/* Hidden */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 2px; }

/* Toast notification */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sage);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  z-index: 2000;
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
