:root {
  --bg-a: #11253d;
  --bg-b: #0b5c62;
  --card: #ffffff;
  --ink: #10212e;
  --muted: #5e7280;
  --line: #d4dee5;
  --accent: #0e8f86;
  --accent-2: #1673b1;
  --accent-hover: #0b766f;
  --danger: #b11f2e;
  --shadow: 0 26px 50px rgba(0, 0, 0, 0.22);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: linear-gradient(140deg, var(--bg-a), var(--bg-b));
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-shape-a {
  width: 300px;
  height: 300px;
  background: #6fd9ea;
  top: -100px;
  right: -30px;
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  background: #83ffca;
  bottom: -120px;
  left: -30px;
}

.shell {
  width: min(760px, calc(100% - 28px));
  margin: 24px auto;
}

.hero {
  color: #eaf6ff;
  margin-bottom: 14px;
  animation: in-up 0.5s ease both;
}

.kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero h1 {
  margin: 6px 0;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
}

.lead {
  margin: 0;
  color: #d5ecfb;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: in-up 0.55s ease both;
}

.hidden { display: none; }

.status {
  font-size: 1.1rem;
  font-weight: 700;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #d2ecf0;
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-top: 12px;
  animation: spin 1s linear infinite;
}

.hint {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.lgpd {
  background: #f4f9ff;
  border-left: 4px solid var(--accent-2);
  padding: 8px 10px;
  border-radius: 8px;
}

h2 { margin: 2px 0 8px; }

.steps {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
}

.step {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4f6677;
  background: #eef4f7;
}

.step.active {
  background: #d7f2ef;
  color: #0d4f4a;
}

.phase {
  border: 0;
  margin: 0;
  padding: 0;
  display: none;
  gap: 10px;
}

.phase.active {
  display: grid;
  animation: in-up 0.3s ease both;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  font-size: 0.95rem;
}

input:focus {
  border-color: var(--accent-2);
  outline: 3px solid rgba(22, 115, 177, 0.18);
}

input[readonly] {
  background: #f2f5f8;
}

.phase-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ghost {
  background: #e8f3f4;
  color: #12454e;
}

.error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 0.9rem;
}

.meta {
  margin: 12px 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 10px;
  font-size: 0.92rem;
}

.meta dt {
  font-weight: 800;
  color: #334a5b;
}

.meta dd {
  margin: 0;
  color: #204055;
  word-break: break-word;
}

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

@keyframes in-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  html, body {
    height: 100dvh;
    overflow: hidden;
  }

  body {
    min-height: 100dvh;
  }

  .shell {
    width: min(760px, calc(100% - 20px));
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .hero {
    margin-bottom: 0;
  }

  .hero h1 {
    margin: 2px 0;
    font-size: 2rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .card {
    padding: 12px;
    max-height: calc(100dvh - 130px);
    overflow: hidden;
  }

  .steps {
    margin: 8px 0 10px;
    gap: 4px;
  }

  .step {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  .phase {
    gap: 6px;
  }

  label {
    gap: 4px;
    font-size: 0.8rem;
  }

  input {
    padding: 9px;
    font-size: 0.92rem;
  }

  .phase-actions {
    margin-top: 10px;
    gap: 8px;
  }

  button {
    padding: 10px;
    font-size: 0.92rem;
  }

  .hint {
    margin-top: 6px;
    font-size: 0.84rem;
  }

  .lgpd {
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .phase-actions { grid-template-columns: 1fr; }
}
