:root {
  --bg-dark: #060913;
  --bg-surface: rgba(15, 23, 42, 0.68);
  --bg-surface-hover: rgba(30, 41, 59, 0.72);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-highlight: rgba(56, 189, 248, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 25px 60px -15px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

html,
body {
  min-height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Capas de fondo */
#network-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 35%), rgba(56, 189, 248, 0.12), transparent 45%),
    radial-gradient(800px circle at 80% 15%, rgba(129, 140, 248, 0.1), transparent 50%),
    radial-gradient(700px circle at 15% 85%, rgba(52, 211, 153, 0.06), transparent 50%);
  transition: background 0.15s ease-out;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
}

/* Contenedor principal */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  gap: 2rem;
}

/* Barra superior */
.top-bar {
  width: 100%;
  max-width: 780px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--accent-cyan);
}

.brand-name .accent {
  color: var(--accent-cyan);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.lang-option.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

.lang-divider {
  opacity: 0.35;
}

/* Tarjeta principal */
.main-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.25s ease, border-color 0.3s ease;
}

.main-card:hover {
  border-color: rgba(148, 163, 184, 0.24);
}

/* Píldora de estado */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.65);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(251, 191, 36, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
}

/* Títulos */
.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
}

.gradient-text {
  background: linear-gradient(135deg, #f8fafc 0%, #38bdf8 55%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-separator {
  color: var(--text-muted);
  font-weight: 400;
}

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

.maintenance-heading {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.description {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* Contador regresivo */
.countdown-section {
  margin-bottom: 2rem;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.8vw, 0.9rem);
}

.time-box {
  min-width: clamp(64px, 14vw, 88px);
  padding: 0.85rem 0.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.time-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.time-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.15rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.time-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.time-sep {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-muted);
  padding-bottom: 1rem;
}

/* Panel de progreso y estado */
.progress-panel {
  background: rgba(6, 9, 19, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.progress-title {
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-percent {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  position: relative;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 2.2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.panel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ghost-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.chevron {
  transition: transform 0.25s ease;
}

.ghost-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.refresh-icon.spinning {
  animation: spin 0.7s linear infinite;
}

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

/* Lista de servicios */
.services-drawer {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.services-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
}

.service-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.service-name {
  color: var(--text-primary);
  font-weight: 500;
}

.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.service-dot.online {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.service-dot.updating {
  background: var(--accent-amber);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.service-dot.pending {
  background: var(--text-muted);
}

.service-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.service-tag.ok {
  color: var(--accent-emerald);
  background: rgba(52, 211, 153, 0.12);
}

.service-tag.warn {
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.12);
}

.service-tag.wait {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.12);
}

.last-checked {
  margin-top: 0.75rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: right;
}

/* Formulario de notificación */
.notify-section {
  width: 100%;
}

.input-group {
  display: flex;
  gap: 0.6rem;
  background: rgba(6, 9, 19, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.input-group input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  padding: 0.65rem 0.85rem;
}

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

.primary-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #060913;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.35rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.primary-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
}

.form-feedback {
  min-height: 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.83rem;
}

.form-feedback.success {
  color: var(--accent-emerald);
}

.form-feedback.error {
  color: var(--accent-rose);
}

/* Footer */
.footer {
  width: 100%;
  max-width: 780px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.copy-email-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 540px) {
  .input-group {
    flex-direction: column;
  }

  .primary-btn {
    width: 100%;
  }

  .footer {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
