/* ============================================================
   CARS BY LUEL – FRANCHISE APPLICATION STYLES
   ============================================================ */
:root {
  --gold-dark:   #6B4F1D;
  --gold:        #9E7B2F;
  --gold-mid:    #C9A227;
  --gold-light:  #FFF5D6;
  --gold-pale:   #FFFDF5;
  --white:       #ffffff;
  --gray-50:     #fafafa;
  --gray-100:    #f5f5f5;
  --gray-200:    #eeeeee;
  --gray-300:    #e0e0e0;
  --gray-400:    #bdbdbd;
  --gray-600:    #757575;
  --gray-800:    #424242;
  --gray-900:    #1a1a1a;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.12);
  --radius:      12px;
  --radius-sm:   8px;
  --transition:  .3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Montserrat', system-ui, sans-serif; }

.hidden { display: none !important; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0d0d0d 0%, #1a1a1a 40%, #1f1a12 100%);
  overflow: hidden;
  transition: opacity .6s ease, transform .6s ease;
}

.splash.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-content {
  text-align: center;
  z-index: 2;
  animation: splashIn .8s ease-out both;
}

@keyframes splashIn {
  from { opacity: 0; transform: translateY(30px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-logo {
  width: 140px; height: 140px;
  object-fit: contain;
  animation: logoPulse 2s ease-in-out infinite;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 24px rgba(201,162,39,.25));
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

.splash-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: .25rem;
  background: linear-gradient(180deg, #ffffff 0%, #E8C84A 50%, #C9A227 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-sub {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(201,162,39,.85);
  margin-bottom: .5rem;
}

.splash-tagline {
  font-size: 1rem;
  font-style: italic;
  color: rgba(255,255,255,.5);
  margin-bottom: 2rem;
}

.btn-start {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 1rem 2.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--gray-900);
  background: linear-gradient(135deg, #E8C84A, #C9A227);
  border: none; border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201,162,39,.3);
  transition: var(--transition);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,.4);
}

/* Celebration particles */
.splash-particles {
  position: absolute; inset: 0; overflow: hidden; z-index: 1;
}

.particle {
  position: absolute;
  animation: float linear infinite;
}
.particle--sparkle {
  background: rgba(201,162,39,.12);
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}
.particle--confetti {
  border-radius: 2px;
  background: rgba(232,200,74,.1);
}
.particle--star {
  background: rgba(201,162,39,.08);
  clip-path: polygon(50% 0%,61% 25%,98% 25%,68% 45%,79% 75%,50% 55%,21% 75%,32% 45%,2% 25%,39% 25%);
}

@keyframes float {
  from { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  to   { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Celebration cursor sparkles */
.cursor-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  font-size: 14px;
  color: #C9A227;
  animation: sparkleOut .7s ease-out forwards;
}

@keyframes sparkleOut {
  0%   { transform: scale(0) translateY(0); opacity: 1; }
  50%  { transform: scale(1.3) translateY(-18px); opacity: .9; }
  100% { transform: scale(.3) translateY(-50px); opacity: 0; }
}

.cursor-confetti {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 6px; height: 6px;
  border-radius: 1px;
  animation: confettiOut .6s ease-out forwards;
}

@keyframes confettiOut {
  0%   { transform: scale(0) translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background: var(--gray-900);
  border-bottom: 3px solid var(--gold-mid);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: 900px; margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.header-brand {
  display: flex; align-items: center; gap: .75rem;
  cursor: pointer;
}

.header-logo { width: 48px; height: 48px; object-fit: contain; }

.header-name {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 1.1rem;
  color: var(--gold-mid);
}

.header-phone {
  display: block;
  font-size: .8rem; color: var(--gray-600);
}

.header-tag {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600; font-size: .85rem;
  color: var(--gray-900);
  background: var(--gold-mid);
  padding: .35rem 1rem;
  border-radius: 50px;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
  max-width: 900px; margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-mid));
  border-radius: 3px;
  transition: width .4s ease;
  width: 14.28%;
}

.progress-steps {
  display: flex; justify-content: space-between;
  margin-top: .5rem;
  font-size: .7rem; color: var(--gray-400);
  font-weight: 500;
}

.progress-steps span { transition: color var(--transition); }
.progress-steps span.active { color: var(--gold-mid); font-weight: 700; }
.progress-steps span.done { color: var(--gold); }

/* ============================================================
   FORM CONTAINER & STEPS
   ============================================================ */
.form-container {
  max-width: 900px; margin: 0 auto;
  padding: 1.5rem;
  min-height: calc(100vh - 280px);
}

.step {
  display: none;
  animation: stepIn .4s ease-out both;
}
.step.active { display: block; }

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

.step-icon { font-size: 2.5rem; margin-bottom: .5rem; }

.step h2 {
  font-size: 1.75rem; font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: .25rem;
}

.step-desc {
  color: var(--gray-600);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field-grid { display: grid; gap: 1rem; }
.field-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.field-grid .span-1 { grid-column: span 1; }
.field-grid .span-2 { grid-column: span 2; }
.field-grid .span-3 { grid-column: span 3; }
.field-grid .span-4 { grid-column: span 4; }
.field-grid .span-full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .field-grid.cols-2,
  .field-grid.cols-3 { grid-template-columns: 1fr; }
  .field-grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .field-grid .span-1,
  .field-grid .span-2,
  .field-grid .span-3,
  .field-grid .span-4,
  .field-grid .span-full { grid-column: span 1; }
}

.field { display: flex; flex-direction: column; }

.field label, .field-label {
  font-size: .8rem; font-weight: 600;
  color: var(--gray-800);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.optional { font-weight: 400; color: var(--gray-400); text-transform: none; }

.field input,
.field select,
.field textarea {
  padding: .7rem .9rem;
  font-size: .95rem;
  font-family: 'Open Sans', sans-serif;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
}

.field input.invalid,
.field select.invalid,
.field textarea.invalid {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,.12);
}

/* ============================================================
   RADIO GROUP
   ============================================================ */
.radio-group { display: flex; gap: .75rem; margin-top: .5rem; }
.radio-card { cursor: pointer; flex: 1; max-width: 160px; }
.radio-card input { display: none; }

.radio-inner {
  display: flex; align-items: center; justify-content: center;
  padding: .9rem 1.25rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  font-weight: 600; font-size: .95rem;
  transition: var(--transition);
  text-align: center;
}

.radio-card input:checked + .radio-inner {
  border-color: var(--gold-mid);
  background: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
  color: var(--gold-dark);
}

.radio-card:hover .radio-inner { border-color: var(--gold-mid); }

/* ============================================================
   CONDITIONAL FIELDS
   ============================================================ */
.conditional-fields {
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s ease;
  max-height: 0; opacity: 0;
}
.conditional-fields.visible { max-height: 300px; opacity: 1; }

/* ============================================================
   REFERENCE CARDS
   ============================================================ */
.ref-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}
.ref-card:hover { border-color: var(--gold-mid); box-shadow: var(--shadow-sm); }

.ref-card h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold-light);
}

/* ============================================================
   AGREEMENT CHECKBOXES
   ============================================================ */
.agreement-checks { display: flex; flex-direction: column; gap: 1rem; }

.agreement-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  font-size: .95rem; line-height: 1.5;
}
.agreement-item:hover { border-color: var(--gold-mid); }
.agreement-item:has(input:checked) {
  border-color: var(--gold-mid);
  background: var(--gold-pale);
}
.agreement-item input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--gold-mid);
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
}

/* ============================================================
   SIGNATURE
   ============================================================ */
.sig-wrap {
  position: relative;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  height: 160px;
}
.sig-wrap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.btn-clear-sig {
  position: absolute; top: .5rem; right: .5rem;
  padding: .3rem .8rem;
  font-size: .75rem; font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 50px; cursor: pointer;
}

/* ============================================================
   REVIEW
   ============================================================ */
.review-content { display: grid; gap: 1.25rem; }

.review-section {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.review-section h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold-light);
}

.review-row {
  display: flex; justify-content: space-between;
  padding: .3rem 0; font-size: .9rem;
}
.review-row .label { color: var(--gray-600); }
.review-row .value { font-weight: 600; text-align: right; max-width: 60%; }

.review-sig-img {
  max-width: 300px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-top: .5rem;
}

/* ============================================================
   NAVIGATION BUTTONS
   ============================================================ */
.nav-buttons {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 900px; margin: 2rem auto;
  padding: 0 1.5rem 2rem;
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.8rem;
  font-family: 'Montserrat', sans-serif;
  font-size: .95rem; font-weight: 600;
  border: none; border-radius: 50px;
  cursor: pointer; transition: var(--transition);
}

.btn-back { color: var(--gray-600); background: var(--gray-200); }
.btn-back:hover { background: var(--gray-300); }
.btn-back.hidden-vis { visibility: hidden; }

.btn-next {
  color: var(--gray-900);
  background: linear-gradient(135deg, #E8C84A, #C9A227);
  box-shadow: 0 4px 12px rgba(201,162,39,.3);
}
.btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,162,39,.35);
}

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */
.success-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0d0d0d 0%, #1a1a1a 40%, #1f1a12 100%);
  animation: stepIn .5s ease-out both;
}

.success-content { text-align: center; color: var(--white); padding: 2rem; }

.success-check {
  width: 80px; height: 80px;
  margin: 0 auto 1.5rem;
  background: rgba(201,162,39,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--gold-mid);
  animation: popIn .4s ease-out .2s both;
}

@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.success-content h2 { font-size: 2rem; margin-bottom: .75rem; color: var(--gold-mid); }
.success-content p { font-size: 1.05rem; opacity: .9; margin-bottom: .5rem; }
.success-contact { margin-top: 1rem; margin-bottom: 2rem; }

.success-screen .btn-next,
.btn-pdf-success {
  color: var(--gray-900);
  background: var(--gold-mid);
  box-shadow: 0 4px 20px rgba(201,162,39,.3);
}

.btn-pdf-success {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 2rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem; font-weight: 700;
  border: 2px solid rgba(201,162,39,.4);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: .5rem;
}

.btn-pdf-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,.4);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--gray-900);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 2rem 1.5rem;
}

.footer-inner { max-width: 900px; margin: 0 auto; }

.footer-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  opacity: .8;
  margin-bottom: .75rem;
}

.footer p { font-size: .8rem; }
.footer-tag { margin-top: .25rem; opacity: .6; color: var(--gold-mid); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .splash-logo { width: 100px; height: 100px; }
  .splash-title { font-size: 1.75rem; }
  .btn-start { padding: .8rem 1.8rem; font-size: 1rem; }
  .header-tag { display: none; }
  .step h2 { font-size: 1.35rem; }
  .ref-card .field-grid.cols-3 { grid-template-columns: 1fr; }
  .nav-buttons { padding: 0 1rem 1.5rem; }
  .btn { padding: .7rem 1.2rem; font-size: .85rem; }
  .radio-group { flex-direction: column; }
  .radio-card { max-width: 100%; }
}
