:root {
  --bg-gradient-start: #0a2540;
  --bg-gradient-end: #1a4d7a;
  --primary: #f4b740;
  --primary-dark: #d99a1f;
  --text: #1a2b3c;
  --text-muted: #5a6b7c;
  --white: #ffffff;
  --border: #e4e9ef;
  --border-strong: #d6dde5;
  --error: #d9534f;
  --success: #2e8b57;
  --shadow-card: 0 20px 60px rgba(10, 37, 64, 0.25);
  --shadow-soft: 0 4px 12px rgba(10, 37, 64, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  *:hover { transition: none !important; }
}

/* === LAYOUT === */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(40px + var(--safe-top)) 20px calc(40px + var(--safe-bottom));
}

/* === HERO === */
.hero {
  text-align: center;
  color: var(--white);
  margin-bottom: 28px;
  animation: fadeInUp 0.5s ease-out;
}

.badge {
  display: inline-block;
  background: var(--primary);
  color: var(--bg-gradient-start);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(244, 183, 64, 0.3);
}

.hero h1 {
  font-size: clamp(32px, 9vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.highlight {
  color: var(--primary);
  display: inline-block;
}

.subtitle {
  font-size: clamp(16px, 4.2vw, 18px);
  opacity: 0.95;
  margin-bottom: 14px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.note {
  font-size: 14px;
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto 8px;
  line-height: 1.55;
}

.note.italic {
  font-style: italic;
  opacity: 0.75;
  margin-top: 12px;
}

/* === CARD === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

/* === FIELDS === */
.field {
  margin-bottom: 18px;
}

.field label,
.radio-group legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 15px 16px;
  /* font-size 16px é essencial — abaixo disso o iOS faz zoom no focus */
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 52px;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder {
  color: #a8b3bf;
  font-weight: 400;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(244, 183, 64, 0.18);
}

.field input.invalid {
  border-color: var(--error);
  background: #fff5f5;
}

.field input.invalid:focus {
  box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.18);
}

/* === RADIO GROUP === */
.radio-group {
  border: none;
  margin-bottom: 18px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  min-height: 56px;
  user-select: none;
  -webkit-user-select: none;
}

.radio-option:active {
  transform: scale(0.99);
}

.radio-option input[type="radio"] {
  accent-color: var(--primary);
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.radio-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.radio-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: #fffaed;
  box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.12);
}

@media (hover: hover) {
  .radio-option:hover { border-color: var(--primary); }
}

/* === CAMPO INDICAÇÃO === */
.field-indicacao {
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); max-height: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 200px; }
}

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

/* === BUTTON === */
.btn-primary {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--bg-gradient-start);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 10px;
  min-height: 56px;
  transition: transform 0.05s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 20px rgba(244, 183, 64, 0.35);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    box-shadow: 0 12px 28px rgba(244, 183, 64, 0.45);
  }
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(244, 183, 64, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(10, 37, 64, 0.3);
  border-top-color: var(--bg-gradient-start);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* === ERROR === */
.form-error {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff5f5;
  border: 1px solid #ffd1d1;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  text-align: center;
  font-weight: 500;
  animation: shake 0.3s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* === FOOTER === */
.footer {
  text-align: center;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

/* === RESPONSIVO === */
@media (max-width: 380px) {
  .container { padding: 32px 14px; padding-bottom: calc(32px + var(--safe-bottom)); }
  .card { padding: 24px 18px; }
  .hero h1 { font-size: 30px; }
  .badge { font-size: 10px; padding: 7px 14px; }
}

@media (min-width: 600px) {
  .container { padding: 56px 24px; }
  .card { padding: 36px 32px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
