:root {
  --bg: #1A2B49;
  --accent: #0062D2;
  --text: #CBD5E1;
  --field-bg: #FFFFFF;
  --field-text: #1A2B49;
  --bg-card: #213556;
  --border: #34507e;
  --error: #ff7a7a;
  --accent-hover: #0052b0;
  --radius: 12px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body { display: flex; flex-direction: column; }

.topbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
}

.logo {
  height: 34px;
  width: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  flex: 1;
}

.title {
  font-size: 1.5rem;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 24px;
}

.step { animation: fade-in 0.25s ease; }
.hidden { display: none !important; }

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

.field { margin-bottom: 18px; }

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.input {
  width: 100%;
  background: var(--field-bg);
  color: var(--field-text);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder { color: #94a3b8; }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 98, 210, 0.25);
}

.input.invalid {
  border-color: var(--error);
}

.error {
  display: block;
  min-height: 16px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--error);
}

.grupo { margin-bottom: 8px; }
.grupo + .grupo { margin-top: 28px; }

.grupo-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  line-height: 1.2;
}

.grupo-dependente .grupo-title {
  border-left-color: var(--text);
}

.pessoa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 6px;
  margin-bottom: 16px;
}

.pessoa-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pessoa-card .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
}

.grupo-dependente .pessoa-card .badge {
  background: #34507e;
}

.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

#step-sucesso { text-align: center; padding-top: 30px; }

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 600px) {
  .title { font-size: 1.75rem; }

  .pessoa-card .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .actions {
    flex-direction: row-reverse;
  }
  .actions .btn { width: auto; flex: 1; }
}
