/* ============================================
   MiLiquidacion.com — Design System
   Mobile-first, clean, accessible
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #1E3A5F;
  --primary-light: #2a4f7f;
  --primary-dark: #132842;
  --accent: #4A90D9;
  --accent-light: #7ab3e8;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-dark: #eef1f5;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #f59e0b;
  --yellow-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- UTILITIES ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.navbar-brand span {
  color: var(--accent);
}

.navbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.navbar-cta:hover {
  background: var(--primary-light);
}

/* ---- HERO ---- */
.hero {
  padding: 120px 20px 80px;
  background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(74,144,217,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 12px;
  line-height: 1.5;
}

.hero .prescripcion {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 32px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  background: white;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.hero-note {
  margin-top: 16px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ---- TRUST STRIP ---- */
.trust-strip {
  padding: 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.trust-items {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trust-item .icon {
  font-size: 1.2rem;
}

/* ---- HOW IT WORKS ---- */
.how-it-works {
  padding: 80px 20px;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 48px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 50%;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- CTA SECTION ---- */
.cta-section {
  padding: 60px 20px;
  background: var(--bg-alt);
  text-align: center;
}

.cta-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ---- FOOTER ---- */
.footer {
  padding: 30px 20px;
  background: var(--primary-dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  font-size: 0.8rem;
}

.footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

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

.btn-accent:hover {
  background: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-white {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
}

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

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

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

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 20px;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

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

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ---- DROPZONE ---- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-alt);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(74,144,217,0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-light);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}

.file-preview .file-icon {
  font-size: 1.5rem;
}

.file-preview .file-info {
  flex: 1;
}

.file-preview .file-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.file-preview .file-size {
  font-size: 0.75rem;
  color: var(--text-light);
}

.file-preview .file-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

/* ---- PROGRESS BAR ---- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ---- STEP INDICATOR ---- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-dot .dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-light);
  transition: all 0.3s;
}

.step-dot.active .dot {
  background: var(--primary);
  color: white;
}

.step-dot.completed .dot {
  background: var(--green);
  color: white;
}

.step-dot .line {
  width: 40px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.step-dot.completed .line {
  background: var(--green);
}

.step-dot .step-label {
  display: none;
}

/* ---- PAGE CONTAINER ---- */
.page-container {
  padding: 90px 20px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ---- FORM STEPS ---- */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.form-step h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.form-actions .btn {
  flex: 1;
}

/* ---- QUESTIONNAIRE ---- */
.question-card {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.question-card:hover {
  border-color: var(--accent);
}

.question-text {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text);
}

.question-law {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.question-options {
  display: flex;
  gap: 8px;
}

.question-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.question-options input[type="radio"] {
  display: none;
}

.question-options input[type="radio"]:checked + span {
  /* handled by JS */
}

.question-options label.selected {
  border-color: var(--accent);
  background: rgba(74,144,217,0.08);
  color: var(--accent);
  font-weight: 600;
}

.question-detail {
  margin-top: 8px;
}

.question-detail input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}

/* ---- RESULTS TABLE ---- */
.results-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.results-card .card-header {
  padding: 16px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--primary);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.results-table th:nth-child(n+2) {
  text-align: right;
}

.results-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.results-table td:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.results-table tr:nth-child(even) {
  background: var(--bg-alt);
}

.results-table .total-row {
  background: var(--primary) !important;
  color: white;
  font-weight: 700;
}

.results-table .total-row td {
  border-bottom: none;
}

/* ---- CLASSIFICATION BADGE ---- */
.classification-banner {
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 24px;
}

.classification-banner.green {
  background: var(--green-bg);
  border: 2px solid var(--green);
  color: #166534;
}

.classification-banner.yellow {
  background: var(--yellow-bg);
  border: 2px solid var(--yellow);
  color: #92400e;
}

.classification-banner.red {
  background: var(--red-bg);
  border: 2px solid var(--red);
  color: #991b1b;
}

.classification-banner .badge-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.classification-banner .badge-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.classification-banner .badge-text {
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ---- INFO SECTIONS ---- */
.info-section {
  margin-bottom: 24px;
}

.info-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.info-card {
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  margin-bottom: 8px;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text);
}

.info-card .law-ref {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ---- VIOLATIONS LIST ---- */
.violation-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.violation-item.medium {
  border-left-color: var(--yellow);
}

.violation-item .violation-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.violation-item .violation-law {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- CTA FEES BOX ---- */
.fees-box {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 32px;
}

.fees-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.fees-box p {
  opacity: 0.85;
  margin-bottom: 24px;
}

.fees-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.fee-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.fee-card .fee-price {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.fee-card .fee-desc {
  font-size: 0.85rem;
  opacity: 0.8;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1fad55;
}

/* ---- LOADING ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

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

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

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

.loading-text {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.loading-subtext {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 8px;
  animation: slideIn 0.3s ease;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--green);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- CONSENT ---- */
.consent-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.consent-block input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.consent-block label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- SKELETON LOADING ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-dark) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-box {
  height: 200px;
}

/* ---- RESPONSIVE ---- */
@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .fees-options {
    grid-template-columns: 1fr 1fr;
  }

  .step-dot .step-label {
    display: block;
    font-size: 0.7rem;
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
    color: var(--text-light);
  }

  .step-dot {
    position: relative;
  }
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .step-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .results-table td, .results-table th {
    padding: 14px 20px;
  }

  .step-dot .line {
    width: 60px;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 140px 20px 100px;
  }

  .hero h1 {
    font-size: 3.2rem;
  }
}

/* ---- MOBILE CARDS (for results on mobile) ---- */
@media (max-width: 639px) {
  .results-table-mobile .result-card-mobile {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
  }

  .result-card-mobile .concept-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .result-card-mobile .amounts {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-size: 0.8rem;
  }

  .result-card-mobile .amounts .label {
    color: var(--text-light);
    font-size: 0.7rem;
  }

  .result-card-mobile .amounts .value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

@media (min-width: 640px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ---- REVEAL ANIMATION ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
