:root {
  --bg: #0b1120;
  --surface: rgba(15, 23, 42, 0.82);
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-secondary: #38bdf8;
  --radius: 20px;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  overflow-x: hidden;
  position: relative;
}

/* Fundo sutil com grade e brilho */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(680px, 95vw);
  height: min(680px, 95vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.12) 0%,
    rgba(56, 189, 248, 0.06) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Layout principal */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2.5rem);
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Badge de status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fbbf24;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse 2s ease-out infinite;
}

/* Ilustração SVG animada */
.illustration {
  width: min(240px, 70vw);
  margin: 0 auto 1.25rem;
}

.maintenance-svg {
  width: 100%;
  height: auto;
  display: block;
}

.gear-large {
  color: var(--accent-secondary);
  transform-box: view-box;
  transform-origin: 96px 88px;
  animation: spin-cw 10s linear infinite;
}

.gear-small {
  color: #94a3b8;
  transform-box: view-box;
  transform-origin: 147px 64px;
  animation: spin-ccw 8s linear infinite;
}

.wrench {
  transform-box: view-box;
  transform-origin: 132px 90px;
  animation: wrench-rock 2.6s ease-in-out infinite;
}

.spark {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 2.4s ease-in-out infinite;
}

.spark-2 {
  animation-delay: 0.8s;
}

.spark-3 {
  animation-delay: 1.6s;
}

/* Tipografia */
.title {
  font-size: clamp(1.5rem, 4.5vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 2.5vw, 1.05rem);
  max-width: 42ch;
  margin: 0 auto 1.75rem;
}

/* Barra de progresso indeterminada */
.progress-wrapper {
  max-width: 340px;
  margin: 0 auto 2rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  animation: slide-progress 2.2s ease-in-out infinite;
}

.progress-label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Botões */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent);
  color: #0b1120;
}

.btn-primary:hover {
  background-color: #fbbf24;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.32);
  transform: translateY(-1px);
}

/* Rodapé */
.footer {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.footer a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Keyframes */
@keyframes spin-cw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-ccw {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes wrench-rock {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes slide-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

/* Responsividade para telas muito pequenas */
@media (max-width: 440px) {
  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Acessibilidade: respeita preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .gear-large,
  .gear-small,
  .wrench,
  .status-dot,
  .progress-bar,
  .spark {
    animation: none;
  }

  .progress-bar {
    width: 60%;
    left: 20%;
  }
}
