/* ============================================
   FCA LATAM — Global Styles
   ============================================ */

:root {
  --primary: #1a3c5e;
  --primary-light: #2874a6;
  --primary-dark: #0e2a42;
  --primary-bg: #edf2f7;
  --accent: #1a73e8;
  --success: #1b8a4a;
  --success-bg: #ecf9f1;
  --success-light: #d4edda;
  --error: #c0392b;
  --error-bg: #fdecea;
  --warning: #d4820a;
  --warning-bg: #fff8e1;
  --warning-border: #f0c36d;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #94a3b8;
  --border: #cbd5e1;
  --border-focus: var(--primary-light);
  --bg: #f1f5f9;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================
   Container
   ============================================ */

.container {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============================================
   Header
   ============================================ */

.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* Language Toggle (supports 3 buttons) */
.lang-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: 6px;
  padding: 3px;
}

.lang-btn {
  padding: 3px 5px;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
  transition: all var(--transition);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  opacity: 0.55;
}

.lang-btn.active {
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 0 0 1px var(--primary);
}

.lang-btn:hover:not(.active) {
  opacity: 0.85;
}

.lang-btn svg {
  display: block;
  border-radius: 2px;
}

/* ============================================
   Main
   ============================================ */

.main {
  flex: 1;
  padding: 1.25rem 0 3rem;
}

/* ============================================
   Form Card
   ============================================ */

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.form-header {
  text-align: center;
  padding: 2rem 1.5rem 0.75rem;
}

.form-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}

.form-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-wrapper {
  padding: 1rem 1.5rem 1.25rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-step-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--primary);
}

.progress-step-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.progress-fill {
  height: 100%;
  width: 12.5%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.dot:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: scale(1.1);
}

.dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  text-align: center;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer a {
  font-size: 0.75rem;
  color: var(--primary-light);
  text-decoration: none;
}

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

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay p {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   Error Modal
   ============================================ */

.error-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

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

.error-modal-content {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.error-modal-content h3 {
  color: var(--error);
  margin-bottom: 0.625rem;
  font-size: 1.0625rem;
}

.error-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.2;
  min-height: 44px;
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-submit {
  background: var(--success);
  color: var(--white);
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
}

.btn-submit:hover:not(:disabled) {
  background: #157a3e;
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================
   Responsive
   ============================================ */

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }

  .form-header {
    padding: 2.5rem 2rem 1rem;
  }

  .form-header h1 {
    font-size: 1.625rem;
  }

  .progress-wrapper {
    padding: 1rem 2rem 1.25rem;
  }

  .logo img {
    height: 44px;
  }

  .lang-btn {
    padding: 4px 10px;
  }

  .footer .container {
    flex-direction: row;
    justify-content: space-between;
  }

  .dot {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}
