@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

:root {
  --mar-primary: #e53935;
  --mar-accent: #1565c0;
  --mar-text-main: #1a1a2e;
  --mar-text-muted: #64748b;
  --mar-border: #e2e8f0;
  --mar-bg: #f8fafc;
}

#mar-dashboard-root {
  font-family: "Outfit", sans-serif !important;
  color: var(--mar-text-main) !important;
  max-width: 820px;
  margin: 0 auto !important;
  padding: 2rem 1rem !important;
}

/* ─── AUTH CARD ─────────────────────────────── */
.mar-auth-card {
  background: #fff !important;
  padding: 2.75rem !important;
  border-radius: 20px !important;
  box-shadow:
    0 24px 48px -12px rgba(0, 0, 0, 0.1),
    0 0 0 1px var(--mar-border) !important;
  width: 100% !important;
  max-width: 420px !important;
  margin: 4rem auto !important;
  animation: marFade 0.5s ease;
}

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

.mar-auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.mar-auth-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.mar-auth-header p {
  color: var(--mar-text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.mar-form-group {
  margin-bottom: 1.1rem;
}
.mar-form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.mar-auth-card input[type="text"],
.mar-auth-card input[type="email"],
.mar-auth-card input[type="password"] {
  width: 100% !important;
  padding: 0.8rem 1rem !important;
  border: 1.5px solid var(--mar-border) !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-family: "Outfit", sans-serif !important;
  color: var(--mar-text-main) !important;
  background: var(--mar-bg) !important;
  transition: all 0.2s !important;
}
.mar-auth-card input:focus {
  outline: none !important;
  border-color: var(--mar-accent) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.1) !important;
}

.mar-auth-card button[type="submit"] {
  width: 100% !important;
  margin-top: 1.25rem !important;
  padding: 0.85rem !important;
  background: var(--mar-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: "Outfit", sans-serif !important;
  transition: all 0.2s !important;
}
.mar-auth-card button:hover {
  filter: brightness(1.08) !important;
}
.mar-auth-card button:disabled {
  opacity: 0.6 !important;
}

#login-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

.mar-auth-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.mar-auth-links a {
  color: var(--mar-accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.mar-auth-links a:hover {
  text-decoration: underline;
  color: #0d47a1;
}

/* ─── DASHBOARD HEADER ───────────────────────── */
.mar-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.mar-dash-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}
.mar-dash-sub {
  color: var(--mar-text-muted);
  font-size: 0.875rem;
  margin: 0.2rem 0 0;
}

.mar-dash-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mar-profile-btn {
  background: #eff6ff !important;
  border: 1.5px solid #bfdbfe !important;
  color: #1d4ed8 !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: "Outfit", sans-serif !important;
  transition: all 0.2s !important;
}

.mar-profile-btn:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
}

.mar-logout-btn {
  background: none !important;
  border: 1.5px solid var(--mar-border) !important;
  color: var(--mar-text-muted) !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: "Outfit", sans-serif !important;
  transition: all 0.2s !important;
}
.mar-logout-btn:hover {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

/* ─── RESERVATION CARD (flight style) ────────── */
.mar-grid {
  display: grid;
  gap: 0.85rem;
}

.mar-card {
  background: #fff;
  border: 1px solid var(--mar-border);
  border-radius: 14px;
  overflow: hidden;
  animation: marFade 0.4s ease both;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.mar-card:hover {
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Top label (DIRECT / badge) */
.mar-card-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mar-accent);
  padding: 0.55rem 1rem 0.35rem;
  border-bottom: 1px solid var(--mar-border);
}

/* Main body row */
.mar-card-body {
  display: flex;
  align-items: stretch;
  padding: 1.1rem 1.25rem;
  gap: 1rem;
}

/* Left: pick-up */
.mar-card-left,
.mar-card-right {
  display: flex;
  flex-direction: column;
  min-width: 80px;
}

.mar-card-time {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--mar-text-main);
  line-height: 1;
}

.mar-card-city {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--mar-text-main);
}

.mar-card-label-sm {
  font-size: 0.72rem;
  color: var(--mar-text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Center: dashed line + icon */
.mar-card-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.mar-card-route {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.35rem;
}

.mar-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mar-accent);
  flex-shrink: 0;
}

.mar-card-dash {
  flex: 1;
  height: 1px;
  border-top: 2px dashed #cbd5e1;
}

.mar-card-plane {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mar-card-plane img {
  display: block;
  filter: invert(23%) sepia(98%) saturate(1200%) hue-rotate(210deg)
    brightness(92%);
}

.mar-card-duration {
  font-size: 0.75rem;
  color: var(--mar-text-muted);
  font-weight: 500;
}

/* Right: price + button */
.mar-card-right {
  align-items: flex-end;
  justify-content: space-between;
  text-align: right;
}

.mar-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--mar-text-main);
  white-space: nowrap;
}

.mar-card-select {
  background: var(--mar-primary) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.4rem 0.95rem !important;
  border-radius: 6px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: "Outfit", sans-serif !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  transition: filter 0.15s !important;
}
.mar-card-select:hover {
  filter: brightness(1.1) !important;
}

/* Status badge */
.mar-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mar-badge-0 {
  background: #fef9c3;
  color: #854d0e;
}
.mar-badge-1 {
  background: #dcfce7;
  color: #166534;
}
.mar-badge-2 {
  background: #fee2e2;
  color: #991b1b;
}
.mar-badge-3 {
  background: #e0e7ff;
  color: #3730a3;
}

/* ─── EMPTY STATE ─────────────────────────────── */
.mar-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--mar-text-muted);
}
.mar-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.mar-empty p {
  font-size: 0.95rem;
  margin: 0;
}

/* ─── DETAIL VIEW ─────────────────────────────── */
.mar-back-btn {
  background: none !important;
  border: none !important;
  color: var(--mar-accent) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  padding: 0 0 1.25rem !important;
  display: block !important;
  font-family: "Outfit", sans-serif !important;
}
.mar-back-btn:hover {
  text-decoration: underline !important;
}

.mar-profile-card {
  max-width: 520px !important;
  margin: 0 auto 3rem !important;
}

.mar-profile-separator {
  border: none;
  border-top: 1px dashed #e2e8f0;
  margin: 1.25rem 0 1rem;
}

.mar-profile-message {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
}

.mar-profile-message--success {
  color: #16a34a;
}

.mar-profile-message--error {
  color: #dc2626;
}

.mar-detail-card {
  background: #fff;
  border: 1px solid var(--mar-border);
  border-radius: 14px;
  overflow: hidden;
  animation: marFade 0.4s ease;
}

/* Ruta en el detalle: misma estructura que mar-card-body */
.mar-detail-route {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--mar-border);
}

/* Tabla de datos */
.mar-detail-body {
  padding: 0.5rem 1.5rem 1rem;
}

.mar-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
}
.mar-detail-row:last-child {
  border-bottom: none;
}

.mar-detail-label {
  font-size: 0.8rem;
  color: var(--mar-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.mar-detail-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--mar-text-main);
  text-align: right;
}
