:root {
  --bg: #0f0f23;
  --card: #1a1a35;
  --card-hover: #222250;
  --primary: #4A90D9;
  --primary-light: #7CB3F0;
  --text: #e8e8f0;
  --text-muted: #8a8aa0;
  --accent-green: #4CAF50;
  --accent-red: #E53935;
  --accent-orange: #FF9800;
  --border: #2a2a50;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 480px; margin: 0 auto; padding: 0 16px 90px; }

/* Header */
.header {
  position: sticky;
  top: 0;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header .back-btn {
  width: 36px; height: 36px;
  background: var(--card);
  border: none;
  border-radius: 50%;
  color: var(--primary-light);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.header .back-btn:active { background: var(--card-hover); }
.header h1 { font-size: 18px; font-weight: 600; flex: 1; }
.header .back-btn.hidden { visibility: hidden; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
}
.card:active { transform: scale(0.98); background: var(--card-hover); }
.card-icon { font-size: 28px; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card-subtitle { font-size: 13px; color: var(--text-muted); }

/* Menu grid */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.menu-grid .card { text-align: center; padding: 20px 12px; }
.menu-grid .card-icon { font-size: 36px; }
.menu-card-full { grid-column: 1 / -1; }

/* List items */
.list-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}
.list-item:active { background: var(--card-hover); }
.list-item .emoji { font-size: 24px; flex-shrink: 0; }
.list-item .info { flex: 1; }
.list-item .name { font-size: 15px; font-weight: 500; }
.list-item .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item .price { font-size: 14px; font-weight: 600; color: var(--primary-light); white-space: nowrap; }
.list-item .arrow { color: var(--text-muted); font-size: 14px; }

/* Doctor card */
.doctor-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.doctor-photo {
  width: 100%;
  height: 200px;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
.doctor-info { padding: 16px; }
.doctor-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.doctor-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.doctor-desc { font-size: 14px; line-height: 1.5; margin-top: 12px; color: var(--text); }

/* Service detail */
.service-detail { padding: 20px 0; }
.service-detail .price-tag {
  font-size: 28px; font-weight: 700;
  color: var(--primary-light);
  margin: 12px 0;
}
.service-detail .duration { font-size: 14px; color: var(--text-muted); }
.service-detail .description { font-size: 14px; line-height: 1.6; margin-top: 16px; }

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: inherit;
  margin-bottom: 8px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: #3a7bc8; }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-secondary { background: var(--card); color: var(--primary-light); border: 1px solid var(--border); }
.btn-success { background: var(--accent-green); color: #fff; }

/* Appointment wizard */
.wizard-step { margin-top: 12px; }
.wizard-step .step-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.date-btn, .time-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.date-btn:active, .time-btn:active { background: var(--primary); border-color: var(--primary); }
.date-btn.selected, .time-btn.selected { background: var(--primary); border-color: var(--primary); font-weight: 600; }

/* Confirmation */
.confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  margin: 16px 0;
}
.confirm-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.confirm-row:last-child { border-bottom: none; }
.confirm-label { color: var(--text-muted); font-size: 13px; }
.confirm-value { font-size: 14px; font-weight: 500; }

/* Success */
.success-screen { text-align: center; padding: 40px 0; }
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.success-text { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; }

/* FAQ */
.faq-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question .chevron { transition: transform 0.3s; color: var(--text-muted); }
.faq-item.open .faq-question .chevron { transform: rotate(180deg); }
.faq-answer {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 16px 14px; }

/* Cabinet */
.apt-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.apt-card .apt-header { display: flex; justify-content: space-between; align-items: start; }
.apt-card .apt-doctor { font-size: 15px; font-weight: 600; }
.apt-card .apt-spec { font-size: 12px; color: var(--text-muted); }
.apt-card .apt-datetime { margin-top: 8px; font-size: 14px; }
.apt-card .cancel-btn {
  background: none;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* Rating */
.rating-grid { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.rating-btn {
  width: 56px; height: 56px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  font-family: inherit; color: var(--text);
}
.rating-btn:active, .rating-btn.selected { border-color: var(--accent-orange); background: rgba(255, 152, 0, 0.15); }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* Tabs in cabinet */
.tabs { display: flex; gap: 0; margin-bottom: 16px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  font-family: inherit;
  transition: all 0.2s;
}
.tab.active { color: var(--text); background: var(--primary); }

/* Animations */
.screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
