/* ============================================
   CRAYFISH — Cost Estimator Page
   ============================================ */

/* --- Active Nav Link --- */
.nav__link--active { color: var(--accent) !important; }
.nav__link--active::after { width: 100% !important; background: var(--accent); }

/* --- Hero --- */
.est-hero {
  padding: 160px 120px 80px;
  text-align: center;
  display: flex; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(20, 27, 52, 0.3) 0%, transparent 70%);
}
.est-hero__content { max-width: 800px; }
.est-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border-muted);
  margin-bottom: 32px; font-size: 11px; color: var(--text-muted); letter-spacing: 2px;
}
.est-hero__badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease infinite;
}
.est-hero__title {
  font-family: var(--font-display); font-size: clamp(40px, 6vw, 72px);
  font-weight: 700; line-height: 1.05; margin-bottom: 24px;
}
.est-hero__title--accent { color: var(--accent); }
.est-hero__sub {
  font-size: 14px; color: var(--text-muted); line-height: 1.6;
  max-width: 700px; margin: 0 auto;
}

/* --- Form Section --- */
.est-form-section {
  padding: 0 120px 120px;
  display: flex; justify-content: center;
  background: var(--bg);
}

/* --- Terminal --- */
.est-terminal {
  width: 100%; max-width: 800px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* --- Progress --- */
.est-progress { padding: 20px 24px 0; }
.est-progress__labels {
  display: flex; justify-content: space-between;
  margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
}
.est-progress__pct { color: var(--accent); font-weight: 600; }
.est-progress__bar {
  width: 100%; height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px; overflow: hidden;
}
.est-progress__fill {
  width: 14%; height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.25, 0, 0, 1);
}
.est-progress--complete .est-progress__labels span { color: var(--secondary); }
.est-progress--complete .est-progress__fill { background: var(--secondary); }

/* --- Steps --- */
.est-steps { position: relative; }
.est-step {
  display: none; padding: 24px;
}
.est-step.est-step--active { display: block; }

/* Step Header */
.est-step__header { margin-bottom: 24px; }
.est-step__header--center { text-align: center; }
.est-step__num {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: 2px; display: block; margin-bottom: 8px;
}
.est-step__title {
  font-family: var(--font-display); font-size: 28px;
  font-weight: 700; margin-bottom: 8px;
}
.est-step__desc {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}

/* --- Fields --- */
.est-fields { display: flex; flex-direction: column; gap: 16px; }
.est-field { display: flex; flex-direction: column; gap: 6px; }
.est-label {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; color: var(--secondary);
}
.est-input {
  width: 100%; height: 44px; padding: 0 12px;
  background: var(--bg-elevated); border: 1px solid transparent;
  border-radius: 6px; font-family: var(--font-body);
  font-size: 14px; color: var(--text);
  transition: border-color 0.3s var(--ease);
}
.est-input:focus { border-color: var(--accent); outline: none; }
.est-input::placeholder { color: var(--text-muted); }
.est-textarea { height: 100px; padding: 12px; resize: none; line-height: 1.5; }

/* --- Select --- */
.est-select { position: relative; }
.est-select__input {
  width: 100%; height: 44px; padding: 0 36px 0 12px;
  background: var(--bg-elevated); border: 1px solid transparent;
  border-radius: 6px; font-family: var(--font-body);
  font-size: 14px; color: var(--text);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.3s var(--ease);
}
.est-select__input:focus { border-color: var(--accent); outline: none; }
.est-select__input option { background: var(--bg-card); color: var(--text); }
.est-select__icon {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  pointer-events: none;
}

/* --- Card Grid (Platform/Complexity/Timeline) --- */
.est-card-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}
.est-card-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px; border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.est-card-option svg { transition: color 0.3s var(--ease); }
.est-card-option span { font-family: var(--font-body); font-size: 14px; font-weight: 500; }
.est-card-option:hover { border-color: var(--border-muted); }
.est-card-option.selected {
  border-color: var(--accent); border-width: 2px;
  color: var(--text);
}
.est-card-option.selected svg { color: var(--accent); }
.est-card-option--compact { gap: 4px; }
.est-card-option__title { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.est-card-option__desc { font-family: var(--font-body); font-size: 11px; color: var(--text-muted); }

/* --- Radio Options --- */
.est-radio-group { display: flex; flex-direction: column; gap: 8px; }
.est-radio-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.3s var(--ease);
}
.est-radio-option:hover { border-color: var(--border-muted); }
.est-radio__circle {
  width: 18px; height: 18px; min-width: 18px; border-radius: 50%;
  border: 2px solid var(--border-muted);
  position: relative;
  transition: border-color 0.3s var(--ease);
}
.est-radio-option.selected { border-color: var(--accent); border-width: 2px; }
.est-radio-option.selected .est-radio__circle { border-color: var(--accent); }
.est-radio-option.selected .est-radio__circle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.est-radio__content { display: flex; flex-direction: column; gap: 2px; }
.est-radio__title { font-size: 14px; font-weight: 500; color: var(--text-secondary); text-align: left; }
.est-radio-option.selected .est-radio__title { color: var(--text); font-weight: 600; }
.est-radio__desc { font-size: 12px; color: var(--text-muted); text-align: left; }

/* --- Checkbox Grid --- */
.est-check-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.est-check-grid--4 { grid-template-columns: repeat(4, 1fr); }
.est-check-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.est-check-option:hover { border-color: var(--border-muted); }
.est-check__box {
  width: 16px; height: 16px; min-width: 16px; border-radius: 3px;
  border: 1px solid var(--border-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.est-check-option.selected {
  border-color: var(--accent); color: var(--text);
}
.est-check-option.selected .est-check__box {
  background: var(--accent); border-color: var(--accent);
}
.est-check-option.selected .est-check__box::after {
  content: '\2713'; font-size: 11px; color: var(--bg); font-weight: 700;
}

/* --- Toggle --- */
.est-toggle-group { display: flex; flex-direction: column; gap: 12px; }
.est-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 8px;
  background: var(--bg-elevated);
}
.est-toggle__info { display: flex; flex-direction: column; gap: 2px; }
.est-toggle__title { font-size: 14px; font-weight: 500; color: var(--text); }
.est-toggle__desc { font-size: 12px; color: var(--text-muted); }
.est-toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-muted);
  position: relative; cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.est-toggle__knob {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.est-toggle[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
}
.est-toggle[aria-pressed="true"] .est-toggle__knob {
  transform: translateX(20px); background: #fff;
}

/* --- Navigation Buttons --- */
.est-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; margin-top: 8px;
}
.est-nav--end { justify-content: flex-end; }
.est-nav--center { justify-content: center; gap: 12px; flex-wrap: wrap; }
.est-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
}
.est-btn:hover { transform: translateY(-1px); }
.est-btn--primary {
  background: var(--accent); color: var(--bg); border: none;
}
.est-btn--primary:hover { box-shadow: 0 4px 24px var(--accent-glow); }
.est-btn--primary svg { stroke: var(--bg); }
.est-btn--ghost {
  background: none; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.est-btn--ghost:hover { border-color: var(--border-muted); color: var(--text); }
.est-btn--ghost svg { stroke: var(--text-secondary); }

/* --- Results --- */
.est-results { display: flex; flex-direction: column; gap: 24px; }
.est-results__total {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px; border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
}
.est-results__range {
  font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; color: var(--accent); text-align: center;
}
.est-results__note { font-size: 14px; color: var(--text-secondary); }
.est-results__divider { height: 1px; background: var(--border); }
.est-results__cta-desc {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.est-results__disclaimer {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  text-align: center;
}

/* --- Breakdown --- */
.est-breakdown { display: flex; flex-direction: column; gap: 8px; }
.est-breakdown__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 8px;
  background: var(--bg-elevated);
}
.est-breakdown__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.est-breakdown__label svg { color: var(--accent); stroke: var(--accent); }
.est-breakdown__value {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 600; color: var(--accent);
}

/* --- Contact Form --- */
.est-contact__row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 12px;
}

/* --- Field Error State --- */
.est-field--error .est-input,
.est-field--error .est-select__input {
  border-color: #ef4444;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .est-hero { padding: 120px 24px 60px; }
  .est-hero__title { font-size: clamp(32px, 8vw, 48px); }
  .est-form-section { padding: 0 16px 80px; }
  .est-step { padding: 20px 16px; }
  .est-card-grid { grid-template-columns: repeat(2, 1fr); }
  .est-check-grid { grid-template-columns: repeat(2, 1fr); }
  .est-check-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .est-contact__row { grid-template-columns: 1fr; }
  .est-nav--center { flex-direction: column; align-items: stretch; }
  .est-nav--center .est-btn { justify-content: center; }
  .est-results__range { font-size: 28px; }
}

@media (max-width: 480px) {
  .est-card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .est-check-grid { grid-template-columns: 1fr; }
}
