/* ============================================================
   Glasshouse AdSpend Calculator — style.css
   Brand: #5BBFA7 primary, #202732 dark, #F7F7FF background
   Font: Aileron (all)
   ============================================================ */

@font-face {
  font-family: 'Aileron';
  src: url('/static/fonts/Aileron-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aileron';
  src: url('/static/fonts/Aileron-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aileron';
  src: url('/static/fonts/Aileron-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aileron';
  src: url('/static/fonts/Aileron-Heavy.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Aileron', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #202732;
  background-color: #F7F7FF;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.site-header {
  background-color: #202732;
  padding: 16px 0;
  border-bottom: 1px solid #2d3748;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-name {
  color: #ffffff;
  font-family: 'Aileron', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-badge {
  color: #5BBFA7;
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background-color: rgba(91, 191, 167, 0.12);
  border: 1px solid rgba(91, 191, 167, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
}

/* --- Hero --- */
.hero {
  background-color: #202732;
  padding: 60px 0 56px;
  border-bottom: 3px solid #5BBFA7;
  position: relative;
  overflow: hidden;
}

/* Subtle geometric background element */
.hero::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(91, 191, 167, 0.05);
  pointer-events: none;
}

.hero-content { max-width: 680px; position: relative; }

.hero-label {
  display: inline-block;
  color: #5BBFA7;
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  background-color: rgba(91, 191, 167, 0.12);
  border: 1px solid rgba(91, 191, 167, 0.3);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.hero h1 {
  color: #ffffff;
  font-family: 'Aileron', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero-sub {
  color: #8899aa;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 0; }

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}
.stat:first-child { padding-left: 0; }

.stat-value {
  color: #ffffff;
  font-family: 'Aileron', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-label {
  color: #8899aa;
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
  text-align: center;
}

.stat-divider { width: 1px; height: 36px; background-color: rgba(255,255,255,0.1); }

/* --- Calculator Section --- */
.calculator-section { padding: 48px 0 64px; }

.calculator-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(32,39,50,0.06), 0 10px 20px -3px rgba(32,39,50,0.1);
  overflow: hidden;
}

/* --- Progress Bar --- */
.progress-bar {
  display: flex;
  align-items: center;
  padding: 20px 40px;
  background-color: #F7F7FF;
  border-bottom: 1px solid #e8eaed;
}

.progress-step { display: flex; align-items: center; gap: 8px; }

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background-color: #e8eaed;
  color: #9ca3af;
  font-family: 'Aileron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.25s, color 0.25s;
  flex-shrink: 0;
}

.progress-step.active .step-dot { background-color: #5BBFA7; color: #ffffff; }
.progress-step.completed .step-dot { background-color: #202732; color: #ffffff; }
.progress-step.completed .step-dot::before { content: '✓'; }

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
}
.progress-step.active .step-label { color: #202732; }
.progress-step.completed .step-label { color: #5BBFA7; }

.progress-line { flex: 1; height: 2px; background-color: #e8eaed; margin: 0 12px; min-width: 20px; }

/* --- Form Steps --- */
.form-step { padding: 40px; }
.form-step.hidden { display: none !important; }

.step-header { margin-bottom: 32px; }
.step-header h2 {
  font-family: 'Aileron', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #202732;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.step-header p { color: #6b7280; font-size: 14px; line-height: 1.6; }

/* --- Form Elements --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

label { font-size: 13px; font-weight: 700; color: #374151; }
.required { color: #ef4444; }
.optional { color: #9ca3af; font-weight: 400; font-size: 12px; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Aileron', sans-serif;
  font-size: 14px;
  color: #202732;
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

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

input:focus, select:focus {
  border-color: #5BBFA7;
  box-shadow: 0 0 0 3px rgba(91, 191, 167, 0.15);
}

input.error, select.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.field-hint { font-size: 12px; color: #9ca3af; line-height: 1.4; }
.field-error { font-size: 12px; color: #ef4444; font-weight: 600; min-height: 16px; }

/* --- Toggle Buttons (Census Type) --- */
.toggle-group { display: flex; gap: 10px; }

.toggle-btn {
  flex: 1;
  height: 44px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Aileron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  color: #6b7280;
  transition: all 0.2s;
}

.toggle-btn.active {
  background-color: #5BBFA7;
  border-color: #5BBFA7;
  color: #ffffff;
}

.toggle-btn:hover:not(.active) { border-color: #5BBFA7; color: #5BBFA7; }

/* --- Radio Cards --- */
.radio-label-header {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}

.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-option { cursor: pointer; }
.radio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.2s, background-color 0.2s;
}

.radio-option input:checked + .radio-card {
  border-color: #5BBFA7;
  background-color: rgba(91, 191, 167, 0.06);
}

.radio-indicator {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.2s, background-color 0.2s;
  position: relative;
}

.radio-option input:checked + .radio-card .radio-indicator {
  border-color: #5BBFA7;
  background-color: #5BBFA7;
}

.radio-option input:checked + .radio-card .radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background-color: white;
}

.radio-content strong { display: block; font-size: 13px; font-weight: 700; color: #202732; margin-bottom: 2px; }
.radio-content span { font-size: 12px; color: #6b7280; line-height: 1.4; }

/* --- Notice Box --- */
.notice-box {
  display: flex; align-items: flex-start; gap: 10px;
  background-color: rgba(91, 191, 167, 0.08);
  border: 1px solid rgba(91, 191, 167, 0.3);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 28px;
}
.notice-icon { color: #5BBFA7; font-size: 15px; flex-shrink: 0; line-height: 1.5; }
.notice-text { font-size: 13px; color: #374151; line-height: 1.5; }

/* --- Consent Checkbox --- */
.consent-group {
  margin-bottom: 24px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 1px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  background-color: #ffffff;
  transition: background-color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.consent-label input[type="checkbox"]:checked + .consent-checkbox-custom {
  background-color: #5BBFA7;
  border-color: #5BBFA7;
}

.consent-checkbox-custom::after {
  content: '';
  display: none;
  width: 4px;
  height: 7px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.consent-label input[type="checkbox"]:checked + .consent-checkbox-custom::after {
  display: block;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 28px;
  font-family: 'Aileron', sans-serif;
  font-size: 14px; font-weight: 700;
  border-radius: 8px; border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
  letter-spacing: 0.2px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background-color: #5BBFA7; color: #ffffff; }
.btn-primary:hover:not(:disabled) { background-color: #4aab93; }

.btn-ghost { background-color: transparent; color: #6b7280; border: 1.5px solid #d1d5db; }
.btn-ghost:hover { background-color: #F7F7FF; }

.btn-full { width: 100%; }

.step-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 8px; padding-top: 24px;
  border-top: 1px solid #f3f4f6;
}

/* --- Spinner --- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Results Header --- */
.results-header { text-align: center; }

.results-badge {
  display: inline-block;
  background-color: rgba(91, 191, 167, 0.12);
  color: #3a9b87;
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid rgba(91, 191, 167, 0.3);
  margin-bottom: 16px;
}

/* --- Budget Range Card --- */
.budget-range-card {
  background-color: #202732;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
}

.budget-label {
  color: #8899aa;
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.budget-values {
  display: flex; align-items: baseline; justify-content: center; gap: 16px; margin-bottom: 8px;
}

.budget-min, .budget-max { display: flex; align-items: baseline; gap: 4px; }
.budget-currency { color: #5BBFA7; font-size: 22px; font-weight: 400; }
.budget-number { color: #ffffff; font-family: 'Aileron', sans-serif; font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.budget-separator { color: #8899aa; font-size: 16px; }
.budget-period { color: #8899aa; font-size: 13px; margin-bottom: 20px; }

.market-tier-badge {
  display: inline-block; font-family: 'Aileron', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 16px; border-radius: 100px;
}
.market-tier-badge.high { background-color: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.market-tier-badge.moderate { background-color: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.market-tier-badge.low { background-color: rgba(91,191,167,0.15); color: #5BBFA7; border: 1px solid rgba(91,191,167,0.3); }

/* --- Metrics Grid --- */
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }

.metric-card {
  background-color: #F7F7FF; border: 1px solid #e8eaed; border-radius: 10px; padding: 20px; text-align: center;
}

.metric-label {
  color: #6b7280; font-family: 'Aileron', sans-serif;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}

.metric-value { color: #202732; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.metric-note { color: #9ca3af; font-size: 11px; }

/* --- Warning Boxes --- */
.warning-box {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: 8px; padding: 16px 20px; margin-bottom: 16px;
  border-width: 1px; border-style: solid;
}
.warning-orange { background-color: #fff7ed; border-color: #fed7aa; border-left: 4px solid #f97316; }
.warning-blue { background-color: rgba(71,172,254,0.06); border-color: rgba(71,172,254,0.25); border-left: 4px solid #47ACFE; }

.warning-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.warning-orange .warning-icon { color: #f97316; }
.warning-blue .warning-icon { color: #47ACFE; }

.warning-body strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.warning-orange .warning-body strong { color: #9a3412; }
.warning-blue .warning-body strong { color: #1a5fa8; }
.warning-body p { font-size: 13px; line-height: 1.6; margin: 0; }
.warning-orange .warning-body p { color: #9a3412; }
.warning-blue .warning-body p { color: #1a5fa8; }

/* --- Email Confirm Box --- */
.email-confirm-box {
  display: flex; align-items: flex-start; gap: 16px;
  background-color: rgba(91, 191, 167, 0.08);
  border: 1px solid rgba(91, 191, 167, 0.3);
  border-radius: 8px; padding: 20px; margin-bottom: 20px;
}
.email-icon { font-size: 22px; color: #5BBFA7; flex-shrink: 0; }
.email-confirm-box strong { display: block; font-size: 14px; color: #202732; font-weight: 700; margin-bottom: 4px; }
.email-confirm-box p { font-size: 13px; color: #374151; line-height: 1.5; margin: 0; }
.confirm-email { font-weight: 700; text-decoration: underline; text-decoration-style: dotted; }

/* --- Disclaimer --- */
.disclaimer {
  font-size: 11px; color: #9ca3af; line-height: 1.7;
  padding: 16px; background-color: #F7F7FF;
  border-radius: 6px; margin-bottom: 24px;
}
.calc-id { font-family: 'Aileron', sans-serif; font-size: 10px; color: #d1d5db; }

/* --- Results Actions --- */
.results-actions { justify-content: center; border-top: none; }

/* --- Share Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(32,39,50,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: #ffffff; border-radius: 12px;
  padding: 36px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(32,39,50,0.3);
}

.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: #9ca3af; line-height: 1;
  padding: 4px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: #202732; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}

.modal-box h3 {
  font-family: 'Aileron', sans-serif; font-size: 18px; font-weight: 800;
  color: #202732; margin-bottom: 8px;
}
.modal-box p { font-size: 13px; color: #6b7280; margin-bottom: 20px; line-height: 1.6; }

.modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.modal-field label { font-size: 13px; font-weight: 700; color: #374151; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.share-success {
  display: flex; align-items: center; gap: 8px;
  background-color: rgba(91, 191, 167, 0.1);
  border: 1px solid rgba(91, 191, 167, 0.3);
  border-radius: 8px; padding: 12px 16px;
  color: #3a9b87; font-size: 13px; font-weight: 600;
  margin-top: 16px;
}

/* --- Error State --- */
.error-state { text-align: center; padding: 48px 24px; }
.error-icon { font-size: 48px; color: #ef4444; margin-bottom: 16px; }
.error-state h3 { font-size: 20px; font-weight: 800; color: #202732; margin-bottom: 8px; }
.error-state p { font-size: 14px; color: #6b7280; margin-bottom: 24px; }

/* --- Footer --- */
.site-footer { background-color: #202732; padding: 24px 0; border-top: 1px solid #2d3748; }
.site-footer p {
  color: #6b7280; font-size: 12px; text-align: center; line-height: 1.7;
  max-width: 600px; margin: 0 auto;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 24px; }
  .stat { padding: 0 14px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 9px; }
  .progress-bar { padding: 16px 20px; }
  .step-label { display: none; }
  .form-step { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: 1; }
  .radio-group { grid-template-columns: 1fr; }
  .budget-number { font-size: 36px; }
  .budget-currency { font-size: 16px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .step-actions { flex-direction: column-reverse; }
  .btn-full { width: 100%; }
  .header-badge { display: none; }
  .modal-actions { flex-direction: column; }
  .budget-range-card { padding: 24px 20px; }
  .modal-box { padding: 24px 20px; }
  .stat-divider { display: none; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stat { padding: 0; align-items: center; }
  .budget-values { flex-direction: column; align-items: center; gap: 4px; }
  .budget-separator { font-size: 13px; color: #8899aa; }
}
