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

:root {
  --blue: #1a6eb5;
  --blue-dark: #0c447c;
  --blue-light: #e6f1fb;
  --green: #1d9e75;
  --green-light: #eaf3de;
  --red: #e24b4a;
  --red-light: #fff0f0;
  --gray: #f5f5f5;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-muted: #666;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 72px;
}

#app { max-width: 420px; margin: 0 auto; background: #f0f2f5; min-height: 100vh; }

/* HEADER */
.header {
  background: var(--blue);
  color: #fff;
  padding: 16px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { display: flex; justify-content: space-between; align-items: flex-start; }
.header-title { font-size: 20px; font-weight: 700; }
.header-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.header-badge { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.header-badge.open { background: rgba(255,255,255,0.2); color: #fff; }
.header-badge.closed { background: rgba(0,0,0,0.2); color: #fff; }
.header-info { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; opacity: 0.85; }
.header-info span { display: flex; align-items: center; gap: 4px; }
.header-info .icon { width: 14px; height: 14px; fill: currentColor; }

/* NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  background: none;
  border: none;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.nav-btn .icon { width: 22px; height: 22px; fill: currentColor; }
.nav-btn.active { color: var(--blue); }

/* PAGES */
.page { display: none; }
.page.active { display: block; }

/* SUMMARY BAR */
.summary-bar {
  background: #fff;
  display: flex;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.summary-item { flex: 1; text-align: center; }
.summary-num { display: block; font-size: 28px; font-weight: 700; color: var(--blue); line-height: 1; }
.summary-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }
.summary-sep { width: 1px; height: 36px; background: var(--border); }

/* SECTIONS */
.section { padding: 12px 14px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.section-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

/* MACHINES */
.machines-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.machine-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.machine-card.free { border-color: var(--green); background: var(--green-light); }
.machine-card.busy { border-color: #ddd; background: #fafafa; opacity: 0.75; cursor: default; }
.machine-card.selected { border-color: var(--blue); background: var(--blue-light); border-width: 2px; }
.machine-card:active:not(.busy) { transform: scale(0.96); }
.machine-number { font-size: 10px; font-weight: 700; color: var(--blue); background: var(--blue-light); border-radius: 4px; padding: 1px 5px; margin-bottom: 3px; display: inline-block; }
.machine-emoji { font-size: 22px; margin-bottom: 4px; }
.machine-name { font-size: 11px; font-weight: 600; color: var(--text); }
.machine-status { font-size: 10px; margin-top: 2px; }
.machine-status.free { color: var(--green); font-weight: 600; }
.machine-status.busy { color: var(--red); }
.machine-price { font-size: 11px; color: var(--blue); font-weight: 600; margin-top: 3px; }
.btn-claim-wash { margin-top: 6px; background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 5px 8px; font-size: 11px; font-weight: 600; cursor: pointer; width: 100%; }
/* NOTIFICATION */
.notif-card {
  background: var(--blue-light);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-icon { font-size: 24px; flex-shrink: 0; }
.notif-text { flex: 1; }
.notif-text strong { display: block; font-size: 14px; color: var(--blue-dark); }
.notif-text span { font-size: 12px; color: #185fa5; }

.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* FIDELITY */
.fidelity-card {
  background: var(--blue);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
}
.fidelity-header { display: flex; justify-content: space-between; align-items: center; }
.fidelity-card h3 { font-size: 15px; font-weight: 600; }
.fidelity-card p { font-size: 12px; opacity: 0.85; margin-top: 3px; }
.fidelity-score { text-align: right; font-size: 32px; font-weight: 700; line-height: 1; }
.fidelity-score small { font-size: 14px; opacity: 0.7; }
.fidelity-dots { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.fidelity-dot { width: 26px; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.3); transition: background 0.2s; }
.fidelity-dot.filled { background: #fff; }

/* RESERVE */
.reserve-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}
.reserve-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.reserve-price { font-size: 14px; color: var(--blue); font-weight: 600; margin-bottom: 16px; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.form-group input:focus { border-color: var(--blue); }

/* BUTTONS */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 8px;
}
.btn-primary:active { background: var(--blue-dark); }
.btn-secondary {
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:active { background: var(--blue-light); }

/* TARIFS */
.tarif-list { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.tarif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.tarif-item:last-child { border-bottom: none; }
.tarif-name { font-size: 14px; font-weight: 500; }
.tarif-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tarif-price { font-size: 15px; font-weight: 700; color: var(--blue); }

/* INFO CARD */
.info-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-card p { font-size: 14px; }
.info-card a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ACCOUNT */
.account-hero { text-align: center; padding: 20px 0 16px; }
.account-avatar {
  width: 64px; height: 64px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  color: var(--blue);
  font-weight: 700;
}
.account-hero h2 { font-size: 18px; font-weight: 600; }
.account-hero p { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* HISTORY */
.history-item {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-date { font-size: 12px; color: var(--text-muted); }
.history-desc { font-size: 14px; font-weight: 500; }
.history-price { font-size: 14px; font-weight: 700; color: var(--blue); }

/* CLOSED BANNER */
.closed-banner {
  background: var(--red-light);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: #a32d2d;
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: center;
}

/* CHAT */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 72px;
  z-index: 50;
}
.chat-avatar {
  width: 42px; height: 42px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.chat-header strong { display: block; font-size: 15px; font-weight: 600; }
.chat-header span { font-size: 12px; color: var(--text-muted); }
.chat-online {
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}
.chat-messages {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 280px);
  padding-bottom: 80px;
}
.chat-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-bubble.bot {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text);
}
.chat-bubble.user {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-bubble.typing {
  background: #fff;
  border: 1px solid var(--border);
  align-self: flex-start;
  padding: 14px 18px;
}
.typing-dots { display: flex; gap: 5px; align-items: center; }
.typing-dots span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.chat-suggestions button {
  background: var(--blue-light);
  color: var(--blue-dark);
  border: 1px solid #b5d4f4;
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-suggestions button:active { background: #b5d4f4; }
.chat-input-bar {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 100;
}
.chat-input-bar input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: var(--gray);
}
.chat-input-bar input:focus { border-color: var(--blue); background: #fff; }
.chat-send {
  width: 44px; height: 44px;
  background: var(--blue);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send:active { background: var(--blue-dark); }

/* TOAST */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
