/* =============================================================
   Formulário de Candidatura — estilos
   Mobile-first, visual minimalista tipo produto SaaS.
   ============================================================= */

:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-border: #e4e7ec;
  --color-text: #1a1d24;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9aa1ac;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-soft: #eef2ff;
  --color-success: #16a34a;
  --color-success-soft: #ecfdf3;
  --color-error: #dc2626;
  --color-error-soft: #fef2f2;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-focus: 0 0 0 4px rgba(79, 70, 229, 0.15);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- Layout geral ---------------- */

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-7);
  min-height: 100vh;
}

.app-header {
  text-align: center;
  padding: var(--space-6) 0 var(--space-5);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}

.app-header p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 46ch;
  margin-inline: auto;
}

/* ---------------- Barra de progresso ---------------- */

.progress-wrap {
  margin-bottom: var(--space-5);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.35s ease;
  width: 0%;
}

/* ---------------- Cards ---------------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}

@media (min-width: 480px) {
  .card {
    padding: var(--space-6);
  }
}

.step-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 var(--space-1);
  letter-spacing: -0.01em;
}

.step-subheading {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 var(--space-5);
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  animation: fadeIn 0.25s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .step-body, .progress-bar { animation: none; transition: none; }
}

/* ---------------- Campos ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
}

.field-optional {
  font-weight: 400;
  color: var(--color-text-subtle);
  font-size: 0.82rem;
}

.field-help {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: -2px;
}

input[type="text"],
input[type="date"],
input[type="month"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 16px; /* evita zoom automático no iOS */
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  min-height: 52px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

input.field-invalid,
textarea.field-invalid,
select.field-invalid {
  border-color: var(--color-error);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.char-counter {
  font-size: 0.78rem;
  color: var(--color-text-subtle);
  text-align: right;
}

.field-error {
  display: none;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-error);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-error.visible {
  display: flex;
}

/* ---------------- Opções (radio / checkbox) ---------------- */

.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.option-group legend,
.option-group .field-label {
  margin-bottom: var(--space-1);
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 52px;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-card:hover {
  border-color: #c7cbd4;
}

.option-card input {
  width: 20px;
  height: 20px;
  min-height: 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.option-card.is-checked {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.option-card .option-label {
  font-size: 0.95rem;
  flex: 1;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 520px) {
  .option-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------- Escala 1-5 ---------------- */

.scale-group {
  display: flex;
  gap: var(--space-2);
  justify-content: space-between;
}

.scale-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  min-height: 60px;
  justify-content: center;
}

.scale-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.scale-option.is-checked {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.scale-caption {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* ---------------- Upload de currículo ---------------- */

.upload-zone {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  cursor: pointer;
  background: #fafbfc;
}

.upload-zone:hover {
  border-color: var(--color-primary);
}

.upload-zone svg {
  margin: 0 auto var(--space-3);
  color: var(--color-text-subtle);
}

.upload-zone-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.upload-zone-help {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.upload-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  border: 1.5px solid var(--color-success);
  background: var(--color-success-soft);
  border-radius: var(--radius-sm);
}

.upload-result .file-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-all;
}

.upload-remove-btn {
  border: none;
  background: none;
  color: var(--color-error);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}

/* ---------------- Botões ---------------- */

.btn-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.btn {
  flex: 1;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  flex: 0 0 auto;
  padding: 0 var(--space-5);
}

.btn-secondary:hover {
  border-color: #c7cbd4;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------------- Banner de continuação ---------------- */

.resume-banner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  text-align: center;
}

.resume-banner p {
  margin: 0 0 var(--space-4);
  font-size: 0.92rem;
  color: var(--color-text);
}

.resume-banner .btn-row {
  margin-top: 0;
  flex-wrap: wrap;
}

.resume-banner .btn-row .btn {
  flex: 1 1 100%;
}

@media (min-width: 480px) {
  .resume-banner .btn-row .btn {
    flex: 1 1 0;
  }
}

/* ---------------- Revisão ---------------- */

.review-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.review-section + .review-section {
  margin-top: var(--space-4);
}

.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}

.review-section-title {
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.review-edit-btn {
  border: none;
  background: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.review-item:last-child {
  border-bottom: none;
}

.review-item dt {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.review-item dd {
  margin: 0;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.consent-box {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  align-items: flex-start;
}

.consent-box input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.consent-box p {
  margin: 0;
  font-size: 0.88rem;
}

.consent-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ---------------- Tela de sucesso ---------------- */

.success-screen {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-success-soft);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.success-screen h2 {
  font-size: 1.3rem;
  margin: 0 0 var(--space-3);
}

.success-screen p {
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
  max-width: 40ch;
  margin-inline: auto;
}

.success-id {
  display: inline-block;
  margin-top: var(--space-4);
  padding: 8px 16px;
  background: var(--color-bg);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------- Alerta de envio (erro geral) ---------------- */

.submit-alert {
  display: none;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-error-soft);
  color: #7f1d1d;
  font-size: 0.88rem;
  margin-top: var(--space-4);
}

.submit-alert.visible {
  display: flex;
}

/* ---------------- Grupo de experiência (repetível) ---------------- */

.experience-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.experience-block-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.88rem;
}

.checkbox-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Honeypot: invisível para humanos, presente no DOM para bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------- Utilidades responsivas ---------------- */

@media (min-width: 768px) {
  .app-shell {
    padding-top: var(--space-6);
  }
  .app-header h1 {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    max-width: 680px;
  }
}
