/* ============================================================
   QuickCalc Pro — style.css
   Pure CSS — no @apply (Tailwind CDN does not process @apply
   in external stylesheets; all component styles use real CSS)
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid #3b5bdb;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ════════════════════════════════════════
   NAVIGATION
════════════════════════════════════════ */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.nav-link:hover {
  color: #1e3a8a;
  background-color: #f0f4ff;
}

.mobile-nav-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.mobile-nav-link:hover {
  background-color: #f1f5f9;
  color: #1e3a8a;
}

/* ════════════════════════════════════════
   CALCULATOR CARDS
════════════════════════════════════════ */
.calc-card {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(59,91,219,0.08), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.calc-card:hover {
  box-shadow: 0 8px 32px rgba(59,91,219,0.14), 0 2px 8px rgba(0,0,0,0.06);
}

.calc-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}

.calc-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calc-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ════════════════════════════════════════
   INPUT GROUPS
════════════════════════════════════════ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.input-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.875rem;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.input-suffix {
  position: absolute;
  right: 12px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.875rem;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.calc-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 11px 16px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8fafc;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.calc-input::placeholder {
  color: #cbd5e1;
}
.calc-input:focus {
  border-color: #5c7cfa;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(92,124,250,0.15);
}
.calc-input.has-prefix { padding-left: 2.25rem; }
.calc-input.has-suffix { padding-right: 2.25rem; }

/* Select arrow */
select.calc-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 2.5rem;
}

textarea.calc-input { resize: none; }

/* ════════════════════════════════════════
   STEPPER BUTTONS (people count +/−)
════════════════════════════════════════ */
.stepper-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.stepper-btn:hover {
  background: #f0f4ff;
  border-color: #91a7ff;
  color: #2f4ac0;
}
.stepper-btn:active { transform: scale(0.93); }

/* ════════════════════════════════════════
   PRESET QUICK-SELECT BUTTONS
════════════════════════════════════════ */
.preset-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.preset-btn:hover {
  border-color: #5c7cfa;
  color: #2f4ac0;
  background: #f0f4ff;
}
.preset-btn:active { transform: scale(0.93); }

/* ════════════════════════════════════════
   RESULT ROWS
════════════════════════════════════════ */
.result-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.5rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.result-divider::before,
.result-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.result-row-primary {
  background: linear-gradient(to right, #f0f4ff, #ecfdf5);
  border-color: #bac8ff;
}

.result-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #64748b;
}

.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-value {
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.reset-btn {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.reset-btn:hover {
  color: #2f4ac0;
  background: #f0f4ff;
  border-color: #bac8ff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #2f4ac0;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(47,74,192,0.3);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover {
  background: #3b5bdb;
  box-shadow: 0 4px 16px rgba(47,74,192,0.35);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ════════════════════════════════════════
   HOW-IT-WORKS CARDS
════════════════════════════════════════ */
.how-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 24px rgba(59,91,219,0.08), 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s;
}
.how-card:hover {
  box-shadow: 0 8px 32px rgba(59,91,219,0.14), 0 2px 8px rgba(0,0,0,0.06);
}

.how-step {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #2f4ac0;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 2px 8px rgba(47,74,192,0.3);
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer-link {
  color: #94a3b8;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  transition: color 0.15s;
  padding: 0;
}
.footer-link:hover { color: #ffffff; }

/* ════════════════════════════════════════
   AD SLOT PLACEHOLDERS
════════════════════════════════════════ */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ad-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  background: rgba(255,255,255,0.5);
}

.ad-placeholder-rect {
  max-width: 336px;
  height: 280px;
}

.ad-placeholder-dark {
  border-color: #334155;
  background: transparent;
}

/* ════════════════════════════════════════
   MODALS
════════════════════════════════════════ */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  width: calc(100vw - 2rem);
  max-width: 42rem;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.1);
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal.modal-open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #ffffff;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 999px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ── Prose (About, Privacy, Terms) ── */
.prose-modal h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.25rem 0 0.5rem;
}
.prose-modal h3:first-child { margin-top: 0; }

.prose-modal p {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.prose-modal ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.prose-modal ul li {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 0.4rem;
}

.prose-modal a {
  color: #2f4ac0;
  text-decoration: underline;
}
.prose-modal a:hover { color: #3b5bdb; }

/* ── Form errors ── */
.form-error {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 500;
}
.form-error.hidden { display: none; }

/* ── Input error state ── */
.calc-input.input-error {
  border-color: #fca5a5;
  background: #fff5f5;
}
.calc-input.input-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

/* ════════════════════════════════════════
   MOBILE MODAL — bottom sheet on small screens
════════════════════════════════════════ */
@media (max-width: 640px) {
  .modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 1rem 1rem 0 0;
    transform: translateY(100%);
    opacity: 1;
  }
  .modal.modal-open {
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════
   PROGRESS BAR TRANSITION
════════════════════════════════════════ */
#disc-bar {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ════════════════════════════════════════
   SPIN ANIMATION (submit button loading)
════════════════════════════════════════ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.8s linear infinite; }

/* ════════════════════════════════════════
   UTILITY
════════════════════════════════════════ */
.tabular-nums { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
