/* Mismos tokens de color que la app del conductor
   (ver apps/conductor/src/lib/theme.ts), para que las dos apps se vean como
   un mismo producto. */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Figtree:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f8fd;
  --card: #ffffff;
  --card-border: #dde6f2;
  --text: #0b2a55;
  --text-muted: #5b6b84;
  --accent: #0b3a70;
  --accent-soft: #eaf2ff;
  --blue: #2684ff;
  --yellow: #ffd23f;
  --success: #19b96b;
  --success-bg: #e8f8ef;
  --danger: #ef4444;
  --chip-bg: #eaf2ff;
  --shadow: 0 16px 34px -18px rgba(11, 42, 85, 0.35);
  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'Figtree', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 40px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
  line-height: 1.05;
  text-wrap: balance;
}

.brand,
.brand-row .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 13px;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

/* Invitación (pantalla de ingreso del apoderado) */

.invite {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invite h1 {
  margin-top: 10px;
}

.invite form {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.invite label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.invite input[type='text'] {
  height: 52px;
  border: 1.5px solid var(--card-border);
  border-radius: 13px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--card);
  color: var(--text);
}

.invite input[type='text']:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.invite .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
  color: var(--text-muted);
}

.invite .checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
  flex: 0 0 auto;
  margin-top: 1px;
}

.invite button,
.eta button {
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--success);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s ease;
}

.invite button:active,
.eta button:active {
  transform: scale(0.99);
}

.invite button:disabled {
  opacity: 0.55;
}

/* ETA (pantalla en vivo del apoderado) */

.eta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eta-card {
  background: var(--yellow);
  border-radius: 22px;
  padding: 20px 22px 18px;
  color: #10243f;
  text-align: center;
  box-shadow: 0 16px 30px -16px rgba(255, 195, 30, 0.7);
}


.eta-route {
  display: inline-flex;
  align-self: center;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 42, 85, 0.11);
  color: #10243f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eta-label {
  font-size: 14px;
  font-weight: 700;
}

.eta-minutes {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.eta-freshness {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.85;
}

.map-card,
.push-card,
.absence-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.map-kicker {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.map-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--success-bg);
  color: #137a43;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
  white-space: nowrap;
}

.map-live-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: rs-pulse 1.8s infinite;
}

@keyframes rs-pulse {
  0% { box-shadow: 0 0 0 0 rgba(25, 185, 107, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(25, 185, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 185, 107, 0); }
}

.live-map {
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #edf4ff, #f8fbff);
  border: 1px solid var(--card-border);
}

.map-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.rs-map-marker {
  width: 38px !important;
  height: 38px !important;
  border-radius: 999px;
  background: var(--card);
  border: 3px solid #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(11, 42, 85, 0.28);
}

.rs-map-marker.vehicle {
  background: var(--blue);
  border-color: #ffffff;
  outline: 3px solid rgba(38, 132, 255, 0.25);
}

.rs-map-marker span {
  display: block;
  line-height: 1;
  font-size: 18px;
}

.map-updated {
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Línea de tiempo del recorrido */

.timeline {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text-muted);
}

.step .dot {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: var(--card);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.step:not(:last-child) .dot::after {
  content: '';
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: var(--card-border);
}

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

.step.done .dot {
  border-color: var(--success);
  background: var(--success);
}

.step.done .dot::before {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.step.done:not(:last-child) .dot::after {
  background: var(--success);
}

/* El primer paso aún no cumplido es el "actual": anillo azul. */
.step.done + .step:not(.done) .dot {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(38, 132, 255, 0.15);
}

.step-label {
  flex-grow: 1;
  font-size: 15px;
}

.step.done .step-label {
  font-weight: 600;
}

.step-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.push-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.eta button.secondary {
  background: var(--card);
  border: 2px solid var(--accent);
  color: var(--accent);
}
