/* ===========================
   FloodWatch — CSS Principal
   Estética: Industrial/Emergência
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;700&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1628;
  --bg-card: #131929;
  --bg-card2: #161e30;
  --border: #1e2d4a;
  --border-bright: #2a3f6b;
  --accent-orange: #FF6B00;
  --accent-amber: #FFB800;
  --accent-red: #FF2244;
  --accent-cyan: #00D4FF;
  --accent-green: #00FF88;
  --text-primary: #E8EDF8;
  --text-secondary: #7A8BAD;
  --text-dim: #3D4F6E;
  --status-normal: #00FF88;
  --status-watch: #FFB800;
  --status-alert: #FF6B00;
  --status-emergency: #FF2244;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #0a0e1a 80%, transparent);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(255,107,0,0.5);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%,100% { box-shadow: 0 0 16px rgba(255,107,0,0.5); }
  50% { box-shadow: 0 0 28px rgba(255,107,0,0.9); }
}

.logo-text { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; color: var(--text-primary); }
.logo-sub { font-family: var(--font-mono); font-size: 9px; color: var(--accent-orange); letter-spacing: 3px; text-transform: uppercase; margin-top: -4px; }

.header-right { display: flex; align-items: center; gap: 12px; }

.signal-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--status-normal);
  box-shadow: 0 0 8px var(--status-normal);
  animation: pulse 2s infinite;
}

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

.btn-install {
  background: linear-gradient(135deg, var(--accent-orange), #FF4500);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  display: none;
}
.btn-install:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,107,0,0.5); }
.btn-install.visible { display: flex; align-items: center; gap: 6px; }

/* ===== MAIN LAYOUT ===== */
.app-main {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* ===== STATUS BANNER ===== */
.status-banner {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.6s ease;
}

.status-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: currentColor;
}

.status-banner.normal { --c: var(--status-normal); color: var(--c); border-color: var(--c); }
.status-banner.watch  { --c: var(--status-watch);  color: var(--c); border-color: var(--c); }
.status-banner.alert  { --c: var(--status-alert);  color: var(--c); border-color: var(--c); animation: bannerPulse 1.5s infinite; }
.status-banner.emergency { --c: var(--status-emergency); color: var(--c); border-color: var(--c); animation: bannerPulse 0.8s infinite; }

@keyframes bannerPulse {
  0%,100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 0 4px transparent; }
}

.status-label {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 3px;
  color: currentColor;
}

.status-prob {
  text-align: right;
}

.status-prob-num {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 1px;
  color: currentColor;
  line-height: 1;
}

.status-prob-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.2);
  letter-spacing: 1px;
}

/* ===== GAUGE ===== */
.gauge-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.gauge-svg { flex-shrink: 0; }

.gauge-info { flex: 1; }

.gauge-value {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.gauge-unit {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 4px;
}

.gauge-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(255,184,0,0.1);
  border: 1px solid rgba(255,184,0,0.2);
  color: var(--accent-amber);
}

/* ===== WATER WAVE BAR ===== */
.water-bar-wrap {
  margin-top: 14px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  height: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.water-bar-fill {
  height: 100%;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #0044FF, #0099FF, #00CCFF);
}

.water-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent, transparent 20px,
    rgba(255,255,255,0.07) 20px, rgba(255,255,255,0.07) 40px
  );
  animation: waterFlow 2s linear infinite;
}

@keyframes waterFlow {
  from { transform: translateX(-40px); }
  to   { transform: translateX(0); }
}

.water-bar-pct {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: white;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
  z-index: 2;
}

/* ===== RAIN GRID ===== */
.rain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rain-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 8px;
  text-align: center;
}

.rain-val {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.rain-unit { font-family: var(--font-mono); font-size: 9px; color: var(--text-secondary); }

.rain-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 3px;
}

/* ===== FORECAST BAR CHART ===== */
.forecast-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 8px;
}

.forecast-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.forecast-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 1s ease;
  position: relative;
}

.forecast-bar.safe     { background: linear-gradient(180deg, #00AAFF, #0044FF); }
.forecast-bar.watch    { background: linear-gradient(180deg, var(--accent-amber), #FF8800); }
.forecast-bar.danger   { background: linear-gradient(180deg, var(--accent-red), #AA0022); }

.forecast-time {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.forecast-val {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
}

/* ===== HISTORY LINE CHART ===== */
.chart-wrap {
  position: relative;
  height: 100px;
  margin-top: 4px;
}

.chart-wrap svg { width: 100%; height: 100%; }

/* ===== ACTIONS LIST ===== */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.action-item.urgent { border-left: 3px solid var(--accent-red); }
.action-item.warn   { border-left: 3px solid var(--accent-amber); }
.action-item.info   { border-left: 3px solid var(--accent-cyan); }

.action-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ===== SOIL SELECT ===== */
.soil-btns { display: flex; gap: 8px; }

.soil-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card2);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  text-transform: uppercase;
}

.soil-btn.active {
  background: rgba(0,212,255,0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ===== RANGE SLIDER ===== */
.range-wrap { display: flex; align-items: center; gap: 12px; }

input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255,107,0,0.5);
}

.range-val {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent-orange);
  min-width: 50px;
  text-align: right;
}

/* ===== SELECT ===== */
select {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A8BAD' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select:focus { border-color: var(--accent-cyan); }

/* ===== INPUT TEXT ===== */
input[type=text] {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  margin-top: 10px;
  transition: border-color 0.2s;
}

input[type=text]:focus { border-color: var(--accent-cyan); }
input[type=text]::placeholder { color: var(--text-dim); }

/* ===== TOGGLE ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider { background: rgba(0,255,136,0.3); border: 1px solid var(--status-normal); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--status-normal); }

/* ===== SHARE BUTTON ===== */
.btn-share {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,34,68,0.2), rgba(255,34,68,0.05));
  border: 1px solid rgba(255,34,68,0.4);
  border-radius: var(--radius);
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  transition: all 0.2s;
}

.btn-share:hover {
  background: rgba(255,34,68,0.2);
  box-shadow: 0 0 20px rgba(255,34,68,0.2);
}

/* ===== HISTORY TABLE ===== */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 12px;
}

.history-table th {
  color: var(--text-dim);
  text-align: left;
  padding: 6px 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(30,45,74,0.5);
  color: var(--text-secondary);
}

.history-table td:first-child { color: var(--text-dim); }
.history-table td:last-child { text-align: right; }

.hist-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 1px;
}
.hist-badge.normal     { background: rgba(0,255,136,0.1); color: var(--status-normal); }
.hist-badge.watch      { background: rgba(255,184,0,0.1); color: var(--status-watch); }
.hist-badge.alert      { background: rgba(255,107,0,0.15); color: var(--status-alert); }
.hist-badge.emergency  { background: rgba(255,34,68,0.15); color: var(--status-emergency); }

/* ===== UPDATE TICKER ===== */
.update-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 10px;
  text-align: center;
  justify-content: center;
}

.update-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 1.5s infinite;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-bright);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.install-step:last-of-type { border-bottom: none; }

.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  flex-shrink: 0;
}

.step-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-text strong { color: var(--text-primary); }

.btn-close-modal {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-modal:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}

.nav-tab {
  flex: 1;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s;
}

.nav-tab.active .nav-icon { color: var(--accent-orange); }
.nav-tab.active .nav-label { color: var(--accent-orange); }

.nav-icon { font-size: 20px; color: var(--text-dim); transition: color 0.2s; }
.nav-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; transition: color 0.2s; }

/* ===== PAGE SECTIONS ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== FORM LABELS ===== */
.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.form-group { margin-bottom: 16px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ===== TEMPO ESTIMADO ===== */
.eta-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,184,0,0.06);
  border: 1px solid rgba(255,184,0,0.2);
  border-radius: 5px;
  margin-bottom: 12px;
}

.eta-val {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent-amber);
  letter-spacing: 1px;
}

.eta-info { flex: 1; }
.eta-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; }
.eta-desc { font-family: var(--font-body); font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ===== GEOLOCAL ===== */
.geo-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 8px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 12px;
}

.geo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); flex-shrink: 0; }

/* ===========================
   SPLASH SCREEN
   =========================== */
#splashScreen {
  position: fixed;
  inset: 0;
  background: #0a0e1a;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#splashScreen.hide {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.splash-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: gridDrift 8s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 32px 32px; }
}

.splash-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
}

.splash-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,107,0,0.15);
  animation: ringExpand 3s ease-out infinite;
}
.splash-ring:nth-child(2) { animation-delay: 1s; }
.splash-ring:nth-child(3) { animation-delay: 2s; }

@keyframes ringExpand {
  0%   { transform: scale(0.3); opacity: 0.8; border-color: rgba(255,107,0,0.4); }
  100% { transform: scale(1.4); opacity: 0; border-color: rgba(255,107,0,0); }
}

.splash-icon-wrap {
  position: relative;
  z-index: 2;
  margin-bottom: 28px;
  animation: splashIconIn 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}

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

.splash-icon-img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 0 40px rgba(255,107,0,0.5), 0 0 80px rgba(255,107,0,0.2);
  animation: splashGlow 2.5s ease-in-out infinite;
}

@keyframes splashGlow {
  0%,100% { box-shadow: 0 0 40px rgba(255,107,0,0.5), 0 0 80px rgba(255,107,0,0.2); }
  50%      { box-shadow: 0 0 60px rgba(255,107,0,0.8), 0 0 120px rgba(255,107,0,0.35); }
}

.splash-title {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 6px;
  color: var(--text-primary);
  text-align: center;
  position: relative;
  z-index: 2;
  animation: splashTextIn 0.8s 0.2s ease both;
  line-height: 1;
}

.splash-title span {
  color: var(--accent-orange);
}

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

.splash-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--text-secondary);
  text-transform: uppercase;
  text-align: center;
  margin-top: 8px;
  position: relative;
  z-index: 2;
  animation: splashTextIn 0.8s 0.35s ease both;
}

.splash-loader-wrap {
  margin-top: 48px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: splashTextIn 0.6s 0.5s ease both;
}

.splash-loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255,107,0,0.15);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.splash-loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-amber));
  border-radius: 1px;
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--accent-orange);
}

.splash-loader-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.splash-version {
  position: absolute;
  bottom: 24px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

/* ===========================
   INSTALL BUTTON — Aprimorado
   =========================== */
.install-fab {
  position: fixed;
  bottom: 76px;
  right: 16px;
  z-index: 80;
  background: linear-gradient(135deg, #FF6B00, #FF4500);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(255,107,0,0.5), 0 0 0 0 rgba(255,107,0,0.4);
  animation: fabPulse 2.5s infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}

.install-fab.show { display: flex; }
.install-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 28px rgba(255,107,0,0.7); }
.install-fab:active { transform: scale(0.97); }

@keyframes fabPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(255,107,0,0.5), 0 0 0 0 rgba(255,107,0,0.4); }
  50%      { box-shadow: 0 4px 20px rgba(255,107,0,0.5), 0 0 0 8px rgba(255,107,0,0); }
}

.install-fab-icon {
  font-size: 18px;
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* iOS install banner */
.ios-install-banner {
  position: fixed;
  bottom: 76px;
  left: 12px; right: 12px;
  z-index: 80;
  background: var(--bg-card);
  border: 1px solid var(--accent-orange);
  border-radius: 12px;
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.ios-install-banner.show { display: flex; }

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

.ios-banner-icon { font-size: 32px; flex-shrink: 0; }

.ios-banner-text { flex: 1; }
.ios-banner-title { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-primary); letter-spacing: 1px; text-transform: uppercase; }
.ios-banner-desc { font-family: var(--font-body); font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.ios-banner-desc strong { color: var(--accent-orange); }

.ios-banner-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 4px; flex-shrink: 0;
}

/* Installed badge */
.installed-badge {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--status-normal);
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 20px;
  padding: 5px 12px;
}
.installed-badge.show { display: flex; }

/* ===========================
   API STATUS BAR
   =========================== */
#apiStatusBar {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.5s, color 0.5s;
}

/* MODO REAL badge */
#modoRealBadge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.2);
  letter-spacing: 1px;
  transition: all 0.3s;
}

/* Toggle refinement for "modo real" */
#modoRealToggle:checked + .toggle-slider {
  background: rgba(255,107,0,0.3);
  border-color: var(--accent-orange);
}
#modoRealToggle:checked + .toggle-slider::before {
  background: var(--accent-orange);
  box-shadow: 0 0 8px rgba(255,107,0,0.6);
}

/* ===========================
   SOUND TEST BUTTONS
   =========================== */
.sound-test-btn {
  flex: 1;
  min-width: 80px;
  padding: 7px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--c, var(--text-secondary));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.sound-test-btn:hover {
  background: color-mix(in srgb, var(--c, #fff) 15%, transparent);
  border-color: var(--c, var(--border));
  transform: translateY(-1px);
}
.sound-test-btn:active { transform: scale(0.95); }

/* Pulse animation on emergency status banner */
.status-banner.emergency .status-label {
  animation: emergencyText 0.6s ease-in-out infinite alternate;
}
@keyframes emergencyText {
  from { text-shadow: 0 0 0 transparent; }
  to   { text-shadow: 0 0 20px var(--status-emergency), 0 0 40px rgba(255,34,68,0.5); }
}
