/* index.css – Complete Mobile-First Global Styles */

/* ===== CSS RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, "Noto Sans", sans-serif;
  background: linear-gradient(135deg, #f6f3ff, #ede7ff 40%, #e6ddff);
  color: #0b1020;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== CSS Variables ===== */
:root {
  --bg-0: #f6f3ff;
  --bg-1: #ede7ff;
  --bg-2: #e6ddff;
  --brand-400: #8b5cf6;
  --brand-500: #7c3aed;
  --brand-600: #6d28d9;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --text-900: #0b1020;
  --text-700: #40465a;
  --surface: #ffffff;
  --ring: rgba(124,58,237,.35);
  --radius-xl: 20px;
  --shadow-lg: 0 20px 50px rgba(16,24,40,.10);
  --shadow-md: 0 10px 30px rgba(16,24,40,.08);
}

/* ===== Layout Containers ===== */
.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 40px 0;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0;
  line-height: 1.6;
}

.section-title {
  font-size: 24px;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  font-weight: 800;
}

.subtitle {
  color: var(--text-700);
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  max-width: 65ch;
  margin: 0 auto;
}

/* ===== Buttons ===== */
.btn {
  padding: 14px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  color: white;
  box-shadow: 0 8px 24px rgba(124,58,237,0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.4);
}

.btn.secondary {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: white;
  box-shadow: 0 8px 24px rgba(245,158,11,0.35);
}

.btn.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245,158,11,0.4);
}

.btn.ghost {
  background: #f3f4f6;
  color: #374151;
  box-shadow: none;
  border-radius: 12px;
}

.btn.ghost:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.arrow {
  transition: transform 0.18s ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

/* ===== Forms ===== */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

/* ===== Cards ===== */
.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(124,58,237,0.1);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  margin: 0 auto;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ===== HERO SECTION ===== */
.cm-hero {
  position: relative;
  padding: 40px 0;
  background: 
    radial-gradient(800px 400px at 20% -5%, var(--bg-1), transparent),
    radial-gradient(600px 300px at 90% 110%, var(--bg-2), transparent),
    linear-gradient(135deg, var(--bg-0), var(--bg-1) 40%, var(--bg-2));
  overflow: hidden;
}

.cm-hero__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.cm-hero__logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(45deg, var(--brand-400), var(--brand-500));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 20px;
}

.cm-hero__name {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-600);
}

.cm-hero__title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 16px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cm-hero__subtitle {
  text-align: center;
  color: var(--text-700);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

.cm-hero__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ===== ESTIMATOR SECTION ===== */
.cm-estimator {
  padding: 60px 0;
}

.cm-estimator__content {
  position: relative;
}

.cm-estimator__step {
  display: none;
  animation: fadeUp 0.6s ease-out;
}

.cm-estimator__step.active {
  display: block;
}

.cm-estimator__step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
}

.cm-estimator__step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
}

.cm-estimator__fields {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}

.cm-estimator__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-estimator__label {
  font-weight: 700;
  color: var(--brand-600);
  font-size: 16px;
}

.cm-estimator__actions {
  text-align: center;
}

.cm-estimator__loading {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cm-estimator__loading h3 {
  color: var(--brand-500);
  font-size: 20px;
  font-weight: 800;
}

.cm-estimator__loading p {
  color: var(--text-700);
  font-size: 16px;
}

.cm-estimator__results {
  text-align: center;
}

.cm-estimator__result-header {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  color: white;
  text-align: center;
  padding: 32px 20px;
  margin: -24px -20px 32px;
  border-radius: 16px;
}

.cm-estimator__result-header h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 800;
}

.cm-estimator__yearly-range {
  font-size: 28px;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 1px 10px rgba(0,0,0,0.25);
  margin: 8px 0 16px;
}

.cm-estimator__badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.cm-estimator__badge {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.cm-estimator__breakdown {
  margin-bottom: 32px;
}

.cm-estimator__breakdown h4 {
  margin-bottom: 16px;
  color: var(--brand-600);
  font-size: 18px;
}

.cm-estimator__table {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.cm-estimator__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.cm-estimator__row:last-child {
  border-bottom: none;
}

.cm-estimator__row.total {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--brand-400);
  border-bottom: none;
}

/* ===== SUBMIT FORM STYLES ===== */
.cm-submit {
  --p4: #8b5cf6;
  --p5: #7c3aed;
  --p6: #6d28d9;
  --success: #10b981;
  --text: #0b1020;
  --text-light: #40465a;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-focus: rgba(124,58,237,0.3);
  
  padding: 56px 0;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  min-height: 100vh;
}

.cm-submit__title {
  text-align: center;
  font-size: 28px;
  color: var(--p6);
  margin: 0 0 8px;
  font-weight: 800;
  background: linear-gradient(180deg, var(--p4), var(--p6));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cm-submit__subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.cm-submit__form {
  max-width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid rgba(124,58,237,0.12);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(16,24,40,0.08);
  padding: 24px 20px;
}

.cm-submit__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.cm-submit__section {
  background: #faf9ff;
  border: 1px solid rgba(124,58,237,0.08);
  border-radius: 16px;
  padding: 20px;
}

.cm-submit__section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--p5);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
}

.cm-submit__section-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--p4), var(--p5));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.cm-submit__field {
  margin-bottom: 16px;
}

.cm-submit__label {
  display: block;
  color: var(--p5);
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}

.cm-submit__input,
.cm-submit__textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: var(--surface);
  font-family: inherit;
}

.cm-submit__input:focus,
.cm-submit__textarea:focus {
  outline: none;
  border-color: var(--p4);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.cm-submit__textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.cm-submit__input::placeholder,
.cm-submit__textarea::placeholder {
  color: #9ca3af;
}

/* Upload Section */
.cm-submit__upload-section {
  margin-bottom: 32px;
}

.cm-submit__upload {
  border: 2px dashed #c4b5fd;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  background: rgba(139,92,246,0.02);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.cm-submit__upload:hover {
  border-color: var(--p4);
  background: rgba(139,92,246,0.05);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.4);
}

.cm-submit__upload.dragover {
  border-color: var(--p4);
  background: rgba(139,92,246,0.08);
  transform: scale(1.02);
}

.cm-submit__upload.uploaded {
  border-color: var(--success);
  background: rgba(16,185,129,0.05);
}

.cm-submit__upload-content {
  pointer-events: none;
}

.cm-submit__upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: grayscale(0.3);
}

.cm-submit__upload-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.cm-submit__upload-text strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.cm-submit__upload-text span {
  color: var(--text-light);
  font-size: 14px;
}

.cm-submit__upload-hint {
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cm-submit__file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Submit Button */
.cm-submit__btn {
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--p4), var(--p5));
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  position: relative;
  margin-bottom: 16px;
}

.cm-submit__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.35);
}

.cm-submit__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.cm-submit__disclaimer {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.4;
  margin: 16px 0 32px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* Success State */
.cm-submit__success {
  text-align: center;
  padding: 48px 20px;
}

.cm-submit__success h3 {
  font-size: 24px;
  color: var(--success);
  margin: 0 0 12px;
  font-weight: 800;
}

.cm-submit__success p {
  color: var(--text-light);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateX(-20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.fade-up {
  animation: fadeUp 0.6s ease-out both;
}

.animate-fadeIn { animation: fadeUp 0.6s ease-out; }
.animate-slideIn { animation: slideIn 0.6s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ===== Loading States ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #8b5cf6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.cm-submit__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* ===== Grid ===== */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Responsive Images ===== */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ===== Prevent zoom on input focus (iOS) ===== */
input, textarea, select {
  font-size: 16px !important;
}

/* ===== Accessibility ===== */
.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;
}

/* ===== Focus Styles ===== */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

/* ===== Desktop Adjustments ===== */
@media (min-width: 769px) {
  .container {
    padding: 0 24px;
  }
  
  .section {
    padding: 72px 0;
  }
  
  .section-title {
    font-size: 36px;
  }
  
  .subtitle {
    font-size: 20px;
  }
  
  .btn {
    min-width: auto;
    padding: 12px 20px;
  }
  
  .card {
    padding: 56px 40px;
  }
  
  /* Hero desktop styles */
  .cm-hero {
    padding: 64px 0;
  }
  
  .cm-hero__title {
    font-size: 48px;
  }
  
  .cm-hero__subtitle {
    font-size: 20px;
    max-width: 65ch;
  }
  
  .cm-hero__cta {
    flex-direction: row;
    justify-content: center;
  }
  
  /* Estimator desktop styles */
  .cm-estimator__fields {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  
  .cm-estimator__result-header {
    padding: 40px;
    margin: -56px -40px 40px;
  }
  
  .cm-estimator__yearly-range {
    font-size: 36px;
  }
  
  /* Submit form desktop styles */
  .cm-submit {
    padding: 72px 0;
  }
  
  .cm-submit__title {
    font-size: 36px;
    margin-bottom: 12px;
  }
  
  .cm-submit__subtitle {
    font-size: 20px;
    max-width: 65ch;
    margin-bottom: 48px;
  }
  
  .cm-submit__form {
    max-width: 900px;
    padding: 40px;
  }
  
  .cm-submit__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .cm-submit__section {
    padding: 24px;
  }
  
  .cm-submit__section-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .cm-submit__section-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .cm-submit__label {
    font-size: 15px;
  }
  
  .cm-submit__input,
  .cm-submit__textarea {
    padding: 16px 18px;
  }
  
  .cm-submit__textarea {
    min-height: 120px;
  }
  
  .cm-submit__upload {
    padding: 40px 32px;
  }
  
  .cm-submit__upload-icon {
    font-size: 64px;
  }
  
  .cm-submit__upload-text strong {
    font-size: 18px;
  }
  
  .cm-submit__upload-text span {
    font-size: 16px;
  }
  
  .cm-submit__btn {
    min-width: 280px;
    padding: 18px 36px;
    font-size: 18px;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 42px;
  }
  
  .subtitle {
    font-size: 22px;
  }
  
  .cm-hero__title {
    font-size: 56px;
  }
  
  .cm-hero__subtitle {
    font-size: 22px;
  }
  
  .cm-submit__title {
    font-size: 42px;
  }
  
  .cm-submit__subtitle {
    font-size: 22px;
  }
  
  .cm-submit__form {
    max-width: 1000px;
  }
}

/* Mobile full width button */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .cm-submit__btn {
    width: 100%;
    min-width: auto;
  }
  
  .cm-hero__cta {
    gap: 8px;
  }
  
  .btn {
    width: 100%;
  }
}