/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6A4CFF;
  --primary-light: #8B6FFF;
  --primary-lighter: #F0EDFF;
  --bg: #FAFBFF;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --amber: #F59E0B;
  --amber-light: #FFFBEB;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ===== STATUS BAR SPACER ===== */
.status-bar { height: env(safe-area-inset-top, 0px); background: var(--bg); }

/* ===== HEADER ===== */
.app-header {
  padding: 20px 24px 16px;
  text-align: center;
}

.app-header .logo {
  width: 140px;
  height: auto;
  margin-bottom: 12px;
}

.app-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.app-header h1 span { color: var(--primary); }

.app-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== MAIN CONTENT ===== */
.app-content {
  padding: 0 16px 120px;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== NAVIGATION CARD ===== */
.nav-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.nav-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

.nav-card .icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-card .icon-wrapper.purple { background: var(--primary-lighter); color: var(--primary); }
.nav-card .icon-wrapper.blue { background: var(--blue-light); color: var(--blue); }
.nav-card .icon-wrapper.amber { background: var(--amber-light); color: var(--amber); }

.nav-card .icon-wrapper svg { width: 24px; height: 24px; }

.nav-card .card-info { flex: 1; min-width: 0; }

.nav-card .card-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.nav-card .card-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.nav-card .chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-card .chevron svg { width: 20px; height: 20px; }

/* ===== SCREEN ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== SCREEN HEADER ===== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}

.screen-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.screen-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== SCREEN CONTENT ===== */
.screen-content {
  padding: 0 16px 100px;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== CHAT SCREEN ===== */
.chat-icon-large {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--primary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.chat-icon-large svg { width: 36px; height: 36px; color: var(--primary); }

.chat-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.chat-description {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* ===== STEPS ===== */
.step-list { margin-bottom: 32px; }

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-text h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-text p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== CTA BUTTON ===== */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active { transform: scale(0.97); opacity: 0.9; }

.btn-primary svg { width: 20px; height: 20px; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:active { transform: scale(0.97); background: var(--bg); }

/* ===== BOLETOS & TICKETS SCREEN ===== */
.fallback-content {
  text-align: center;
  padding-top: 24px;
}

.fallback-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.fallback-icon.blue { background: var(--blue-light); }
.fallback-icon.amber { background: var(--amber-light); }

.fallback-icon svg { width: 40px; height: 40px; }
.fallback-icon.blue svg { color: var(--blue); }
.fallback-icon.amber svg { color: var(--amber); }

.fallback-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.fallback-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
}

.nav-item.active { color: var(--primary); }

.nav-item svg { width: 24px; height: 24px; }

.nav-item span {
  font-size: 11px;
  font-weight: 500;
}

/* ===== WEBVIEW CONTAINER ===== */
.webview-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 200;
  display: none;
}

.webview-container.active { display: flex; flex-direction: column; }

.webview-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}

.webview-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  color: var(--text);
}

.webview-header .url-text {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webview-frame {
  flex: 1;
  border: none;
  width: 100%;
}

/* ===== LOADING ===== */
.loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== FADE IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.3s ease forwards;
}

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