/* ================================================
   IRONO — Design System
   Apple iOS-style palette & components
   ================================================ */

:root {
  --blue:        #0A84FF;
  --blue-teal:   #32ADE6;
  --blue-sky:    #5AC8FA;
  --blue-pale:   #EBF5FF;
  --blue-ultra:  #F0F8FF;
  --bg:          #F2F2F7;
  --white:       #FFFFFF;
  --text:        #000000;
  --text-2:      #3C3C43;
  --text-3:      #8E8E93;
  --sep:         rgba(60,60,67,.12);
  --green:       #34C759;
  --orange:      #FF9F0A;
  --red:         #FF3B30;
  --fill-1:      rgba(120,120,128,.2);
  --fill-2:      rgba(120,120,128,.16);
  --fill-3:      rgba(120,120,128,.12);
  --border-r-sm: 12px;
  --border-r-md: 16px;
  --border-r-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--border-r-md);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  overflow: hidden;
}
.card-inner { padding: 16px; }
.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 12px;
}

/* ── BOTTOM TAB BAR ── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(249,249,249,.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
  padding: 8px 0 env(safe-area-inset-bottom, 16px);
  z-index: 100;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; cursor: pointer; padding: 2px 0;
  font-size: 10px; color: var(--text-3); font-weight: 400;
  text-decoration: none; transition: color .15s;
}
.tab-item.active { color: var(--blue); }
.tab-icon { font-size: 22px; line-height: 1; }

/* ── HERO HEADERS ── */
.hero-blue {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-teal) 100%);
  padding: 12px 20px 20px;
}
.hero-dark {
  background: linear-gradient(160deg, #1C1C1E 0%, #2C2C2E 100%);
  padding: 12px 22px 20px;
}
.hero-teal {
  background: linear-gradient(160deg, var(--blue-teal) 0%, var(--blue-sky) 100%);
  padding: 12px 22px 20px;
}
.hero-title {
  font-size: 28px; font-weight: 700; color: white; letter-spacing: -.5px;
}
.hero-sub {
  font-size: 10px; color: rgba(255,255,255,.4);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 3px;
}
.hero-name {
  font-size: 30px; font-weight: 700; color: white; letter-spacing: -.5px; margin-bottom: 12px;
}

/* ── STATS ROW ── */
.stats-row { display: flex; gap: 8px; }
.stat-cell {
  flex: 1; background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px; text-align: center;
}
.stat-val { font-size: 16px; font-weight: 700; color: white; }
.stat-lbl { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 2px; }

/* ── CLARA CARD ── */
.clara-card {
  background: var(--white); border-radius: var(--border-r-md);
  padding: 14px; display: flex; gap: 12px; align-items: flex-start;
  border-left: 3px solid var(--blue);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 10px;
}
.clara-card-text { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.clara-card-text strong { color: var(--blue); font-weight: 600; }
.clara-card-text b { color: var(--blue-teal); }

/* ── NFC STEPS ── */
.nfc-steps { display: flex; gap: 6px; }
.nfc-step {
  flex: 1; background: var(--fill-3); border-radius: 12px;
  padding: 10px 4px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer; transition: all .15s;
}
.nfc-step span:first-child { font-size: 22px; }
.nfc-step span:last-child { font-size: 10px; font-weight: 500; color: var(--text-3); }
.nfc-step.done { background: #E8FAF0; }
.nfc-step.done span:last-child { color: var(--green); }
.nfc-step.active { background: var(--blue-pale); border: 1.5px solid var(--blue); }
.nfc-step.active span:last-child { color: var(--blue); }

/* ── BUTTONS ── */
.btn {
  border: none; border-radius: 14px; padding: 14px;
  font-family: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; width: 100%; transition: opacity .15s;
}
.btn:active { opacity: .75; }
.btn-blue { background: var(--blue); color: white; }
.btn-fill { background: var(--fill-3); color: var(--blue); }

/* ── PILLS ── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.pill-blue   { background: var(--blue-pale); color: var(--blue); }
.pill-green  { background: #E8FAF0; color: var(--green); }
.pill-orange { background: #FFF5E6; color: var(--orange); }
.pill-gray   { background: var(--fill-3); color: var(--text-3); }
.pill-red    { background: #FFECEB; color: var(--red); }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 4px; border-radius: 2px; background: var(--fill-3); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-sky), var(--blue));
}

/* ── TIMELINE ── */
.tl-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 14px 0; position: relative;
}
.tl-item:last-child { padding-bottom: 14px; }
.tl-item:not(:last-child)::after {
  content: ''; position: absolute;
  left: 27px; top: 52px; width: 2px; height: calc(100% - 14px);
  background: var(--sep);
}
.tl-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill-3); display: flex; align-items: center;
  justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1;
}
.tl-icon.done { background: var(--green); }
.tl-icon.curr { background: var(--blue); box-shadow: 0 0 0 4px rgba(10,132,255,.15); }
.tl-info h4 { font-size: 15px; font-weight: 500; color: var(--text); }
.tl-info p  { font-size: 13px; color: var(--text-3); margin-top: 1px; }
.tl-info .ts { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── MAP PLACEHOLDER ── */
.map-ph {
  background: linear-gradient(135deg, var(--blue-pale) 0%, #dff0fb 100%);
  border-radius: 12px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--blue); font-weight: 600; margin-bottom: 12px;
}

/* ── MISSION CARD ── */
.mission-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-teal) 100%);
  border-radius: 20px; padding: 18px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 20px rgba(10,132,255,.3);
  margin-bottom: 10px;
}
.mission-badge {
  background: rgba(255,255,255,.2); border-radius: 8px;
  padding: 3px 10px; font-size: 11px; color: white;
  font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  display: inline-block; margin-bottom: 5px;
}
.mission-price { font-size: 32px; font-weight: 700; color: white; letter-spacing: -1px; }
.mission-price-lbl { font-size: 12px; color: rgba(255,255,255,.55); text-align: right; }

/* ── CLARA SCREEN ── */
.clara-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A84FF 0%, #32ADE6 45%, #5AC8FA 75%, #F2F2F7 100%);
  display: flex; flex-direction: column;
  padding-bottom: 80px;
}
.clara-top {
  text-align: center; padding: 16px 0 10px;
  font-size: 17px; font-weight: 600; color: white;
}
.av-outer {
  width: 152px; height: 152px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  animation: pulse 3.5s ease-in-out infinite; margin: 20px auto;
  position: relative;
}
.av-outer::before {
  content: ''; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
  animation: pulse 3.5s ease-in-out infinite .6s;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
.av-inner {
  width: 124px; height: 124px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; font-size: 58px;
}
.clara-bubble {
  margin: 0 16px 12px;
  background: rgba(255,255,255,.95); border-radius: 20px 20px 20px 6px;
  padding: 14px 16px; box-shadow: 0 8px 32px rgba(10,132,255,.2);
}
.clara-bubble-hd { font-size: 15px; font-weight: 600; color: #000; margin-bottom: 5px; }
.clara-bubble-body { font-size: 14px; line-height: 1.55; color: #3C3C43; }
.clara-chips { padding: 0 16px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip-ios {
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35);
  color: white; font-size: 13px; font-weight: 500;
  padding: 7px 16px; border-radius: 20px; cursor: pointer; white-space: nowrap;
  text-decoration: none; display: inline-block; backdrop-filter: blur(10px);
}
.chip-ios:active { background: rgba(255,255,255,.35); }
.clara-input-bar { padding: 0 16px 8px; }
.ios-input {
  background: rgba(255,255,255,.9); border-radius: 26px;
  display: flex; align-items: center; padding: 10px 10px 10px 18px; gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1); backdrop-filter: blur(20px);
}
.ios-input input {
  flex: 1; border: none; background: transparent;
  font-family: inherit; font-size: 15px; color: #000; outline: none;
}
.ios-input input::placeholder { color: #8E8E93; }
.mic-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue); border: none; cursor: pointer;
  color: white; font-size: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(10,132,255,.4);
}
.clara-footer {
  text-align: center; font-size: 10px; color: rgba(255,255,255,.35);
  letter-spacing: 1.5px; text-transform: uppercase; padding: 0 0 8px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1C1C1E;
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #34C759; }
.toast.error   { background: #FF3B30; }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-3);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-text { font-size: 14px; line-height: 1.5; }

/* ── ROWS (list items) ── */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: .5px solid var(--sep);
}
.row:last-child { border-bottom: none; }
.row-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  flex-shrink: 0;
}
.row-text { flex: 1; }
.row-text h4 { font-size: 15px; font-weight: 500; color: var(--text); }
.row-text p  { font-size: 13px; color: var(--text-3); margin-top: 1px; }

/* ── STEP CARDS (commande flow) ── */
.step {
  background: var(--white); border-radius: var(--border-r-md); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1.5px solid transparent; transition: border-color .2s;
}
.step.done { border-color: rgba(52,199,89,.3); }
.step.active { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10,132,255,.08); }
.step-hd { display: flex; align-items: center; gap: 12px; padding: 14px; }
.step-n {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill-3); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.step-n.done { background: var(--green); color: white; }
.step-n.curr { background: var(--blue); color: white; }
.step-info h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.step-info p  { font-size: 13px; color: var(--text-3); margin-top: 1px; }
