/* ==========================================================
   calc-style.css  —  Health & Fitness Calculator Design System
   How2.me  |  v1.0
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset & Base ── */
.calc-page-wrap *, .calc-page-wrap *::before, .calc-page-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.calc-page-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e293b;
  background: #f8fafc;
  min-height: 60vh;
}

/* ── Hero Section ── */
.calc-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.calc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.calc-hero-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.calc-hero-icon {
  font-size: 3rem;
  margin-bottom: .75rem;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.2));
}
.calc-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: .5rem;
}
.calc-hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  line-height: 1.6;
  font-weight: 400;
}

/* ── Main Container ── */
.calc-container {
  max-width: 960px;
  margin: -2rem auto 3rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media(min-width: 768px) {
  .calc-container {
    grid-template-columns: 1.1fr .9fr;
    align-items: start;
  }
}

/* ── Card ── */
.calc-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(15,23,42,.10), 0 1px 4px rgba(15,23,42,.06);
  padding: 1.75rem;
}
.calc-info-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  padding: 1.5rem;
}
.calc-info-card h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #f1f5f9;
}
.calc-info-card h3 {
  font-size: .9rem;
  font-weight: 700;
  color: #475569;
  margin: 1rem 0 .5rem;
}
.calc-info-card p {
  font-size: .875rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: .6rem;
}
.calc-info-card ul {
  padding-left: 1.25rem;
  font-size: .875rem;
  color: #475569;
  line-height: 1.8;
}

/* ── Unit Toggle ── */
.calc-unit-toggle {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  background: #f1f5f9;
  border-radius: 12px;
  padding: .3rem;
}
.unit-btn {
  flex: 1;
  padding: .55rem .5rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: .82rem;
  color: #64748b;
  transition: all .2s ease;
  font-family: inherit;
}
.unit-btn.active {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.unit-btn:hover:not(.active) {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Form Fields ── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: .85rem;
}
.calc-grid.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}
@media(max-width: 480px) {
  .calc-grid { grid-template-columns: 1fr; }
}
.calc-field {
  margin-bottom: .85rem;
}
.calc-field:last-child {
  margin-bottom: 0;
}
.calc-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: .35rem;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.calc-input {
  width: 100%;
  padding: .65rem .85rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -moz-appearance: textfield;
}
.calc-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.calc-input:hover:not(:focus) {
  border-color: #cbd5e1;
}
.calc-input::placeholder {
  color: #94a3b8;
}
/* Remove arrows from number inputs */
.calc-input[type=number]::-webkit-outer-spin-button,
.calc-input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
select.calc-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Result Box ── */
.calc-result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f1f5f9;
  animation: fadeSlideUp .3s ease;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.result-label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.result-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
@media(max-width: 480px) {
  .result-value { font-size: 1.6rem; }
}

/* ── Result Grid (secondary KPIs) ── */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-top: .75rem;
}
@media(max-width: 400px) {
  .result-grid { grid-template-columns: 1fr; }
}
.result-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: .65rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.ri-label {
  font-size: .72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ri-val {
  font-size: .95rem;
  font-weight: 800;
  color: #1e293b;
}

/* ── Result Badge ── */
.result-badge {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding: .45rem 1.5rem;
  border-radius: 999px;
  display: block;
  width: fit-content;
  margin: .5rem auto;
}

/* ── Info Table ── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin: .5rem 0;
}
.info-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .5rem .65rem;
  text-align: left;
}
.info-table td {
  padding: .5rem .65rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  line-height: 1.4;
}
.info-table tr:last-child td {
  border-bottom: none;
}
.info-table tr:hover td {
  background: #f8fafc;
}

/* ── Preset Buttons ── */
.preset-btn {
  padding: .35rem .75rem;
  border: 1.5px solid #c7d2fe;
  border-radius: 6px;
  background: #f0f4ff;
  color: #4f46e5;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
}
.preset-btn:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}

/* ── Calculate Button (optional) ── */
.calc-btn {
  width: 100%;
  padding: .85rem 1.5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 1rem;
  transition: all .2s ease;
  box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
}
.calc-btn:active {
  transform: translateY(0);
}

/* ── Responsive Tweaks ── */
@media(max-width: 767px) {
  .calc-hero { padding: 2rem 1rem 3rem; }
  .calc-card { padding: 1.25rem; }
  .calc-info-card { padding: 1.25rem; }
  .result-value { font-size: 1.5rem; }
}
