/* ============================================
   Ideal Weight Calculator – style.css v1.0.0
   ============================================ */

.iwcalc-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

.iwcalc-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 700px;
  margin: 0 auto 40px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.13);
  background: #ffffff;
  border: 1px solid #d1fae5;
}

/* ── Header ── */
.iwcalc-header {
  background: linear-gradient(135deg, #0f4c3a 0%, #1a7a54 55%, #00c896 100%);
  padding: 36px 32px 28px;
  text-align: center;
  color: #fff;
}
.iwcalc-theme-blue .iwcalc-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f6ecd 55%, #38bdf8 100%);
}
.iwcalc-theme-purple .iwcalc-header {
  background: linear-gradient(135deg, #3b0764 0%, #7c3aed 55%, #a78bfa 100%);
}
.iwcalc-header-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
.iwcalc-title {
  font-size: 1.9rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin: 0 0 8px !important;
  line-height: 1.2 !important;
}
.iwcalc-subtitle { color: rgba(255,255,255,0.82); font-size: 0.92rem; margin: 0; }

/* ── Unit Toggle ── */
.iwcalc-unit-toggle-wrap { padding: 20px 24px 0; }
.iwcalc-unit-toggle {
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #d1fae5;
  background: #f0fdf4;
}
.iwcalc-unit-btn {
  flex: 1;
  padding: 12px 10px;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  flex-direction: column;
  line-height: 1.3;
}
.iwcalc-unit-sub {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.75;
  display: block;
}
.iwcalc-unit-btn:hover { background: rgba(26,122,84,0.07); color: #1a7a54; }
.iwcalc-unit-btn.active {
  background: linear-gradient(135deg, #1a7a54, #00c896);
  color: #fff !important;
}
.iwcalc-unit-btn.active .iwcalc-unit-sub { opacity: 0.88; }
.iwcalc-theme-blue .iwcalc-unit-btn.active { background: linear-gradient(135deg,#1e3a5f,#0f6ecd); }
.iwcalc-theme-purple .iwcalc-unit-btn.active { background: linear-gradient(135deg,#3b0764,#7c3aed); }

/* ── Form ── */
.iwcalc-form-wrap { padding: 22px 24px; }
.iwcalc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.iwcalc-field-full { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .iwcalc-field-row { grid-template-columns: 1fr; }
}

.iwcalc-field { display: flex; flex-direction: column; gap: 6px; }
.iwcalc-label {
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.iwcalc-optional { font-size: 0.68rem; font-weight: 500; color: #94a3b8; text-transform: none; }

.iwcalc-input-wrap { position: relative; display: flex; align-items: center; }
.iwcalc-input {
  width: 100%;
  padding: 11px 48px 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -moz-appearance: textfield;
}
.iwcalc-input::-webkit-outer-spin-button,
.iwcalc-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.iwcalc-input:focus {
  border-color: #1a7a54;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,122,84,0.13);
}
.iwcalc-theme-blue .iwcalc-input:focus { border-color:#0f6ecd; box-shadow:0 0 0 3px rgba(15,110,205,0.13); }
.iwcalc-theme-purple .iwcalc-input:focus { border-color:#7c3aed; box-shadow:0 0 0 3px rgba(124,58,237,0.13); }

.iwcalc-unit-badge {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  pointer-events: none;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 5px;
}

/* ── Gender Buttons ── */
.iwcalc-gender-btns { display: flex; gap: 12px; }
.iwcalc-gender-btn {
  flex: 1;
  padding: 12px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.iwcalc-gender-icon { font-size: 1.3rem; }
.iwcalc-gender-btn:hover { border-color: #1a7a54; color: #1a7a54; background: #f0fdf4; }
.iwcalc-gender-btn.active {
  border-color: #1a7a54;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #0f4c3a;
  font-weight: 700;
}
.iwcalc-theme-blue .iwcalc-gender-btn.active { border-color:#0f6ecd; background:linear-gradient(135deg,#eff6ff,#dbeafe); color:#1e3a5f; }
.iwcalc-theme-purple .iwcalc-gender-btn.active { border-color:#7c3aed; background:linear-gradient(135deg,#faf5ff,#ede9fe); color:#3b0764; }

/* ── Calculate Button ── */
.iwcalc-btn-row { margin-top: 6px; }
.iwcalc-calc-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f4c3a, #1a7a54, #00c896);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(26,122,84,0.35);
  letter-spacing: 0.02em;
}
.iwcalc-calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,122,84,0.45);
}
.iwcalc-theme-blue .iwcalc-calc-btn { background:linear-gradient(135deg,#1e3a5f,#0f6ecd,#38bdf8); box-shadow:0 4px 16px rgba(15,110,205,0.35); }
.iwcalc-theme-purple .iwcalc-calc-btn { background:linear-gradient(135deg,#3b0764,#7c3aed,#a78bfa); box-shadow:0 4px 16px rgba(124,58,237,0.35); }

/* ── Results ── */
.iwcalc-results { padding: 0 24px 28px; }

/* Primary Banner */
.iwcalc-primary-result {
  background: linear-gradient(135deg, #0f4c3a, #1a7a54, #00c896);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.iwcalc-primary-result::before {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  top: -60px; right: -40px;
}
.iwcalc-theme-blue .iwcalc-primary-result { background:linear-gradient(135deg,#1e3a5f,#0f6ecd,#38bdf8); }
.iwcalc-theme-purple .iwcalc-primary-result { background:linear-gradient(135deg,#3b0764,#7c3aed,#a78bfa); }
.iwcalc-primary-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-bottom: 8px; }
.iwcalc-primary-value { font-size: 3rem; font-weight: 900; line-height: 1; margin-bottom: 8px; }
.iwcalc-primary-sub { font-size: 0.82rem; opacity: 0.82; }

/* Range Section */
.iwcalc-range-section { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; margin-bottom: 20px; }
.iwcalc-range-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.iwcalc-range-label { font-size: 0.8rem; font-weight: 700; color: #374151; }
.iwcalc-range-value { font-size: 0.85rem; font-weight: 700; color: #1a7a54; }
.iwcalc-range-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.iwcalc-range-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #1a7a54, #00c896);
  transition: width 0.5s ease;
}
.iwcalc-range-pointer {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  background: #fff;
  border: 3px solid #0f4c3a;
  border-radius: 50%;
  transition: left 0.5s ease;
}
.iwcalc-range-ticks { display: flex; justify-content: space-between; font-size: 0.7rem; color: #94a3b8; font-weight: 600; }

/* Formulas Grid */
.iwcalc-formulas-section { margin-bottom: 20px; }
.iwcalc-formulas-title { font-size: 0.9rem; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.iwcalc-formulas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .iwcalc-formulas-grid { grid-template-columns: repeat(2, 1fr); } }
.iwcalc-formula-card {
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.iwcalc-formula-name { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.88; margin-bottom: 6px; }
.iwcalc-formula-value { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.iwcalc-formula-desc { font-size: 0.65rem; opacity: 0.78; }
.iwcalc-f-green   { background: linear-gradient(135deg, #065f46, #059669); }
.iwcalc-f-teal    { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.iwcalc-f-emerald { background: linear-gradient(135deg, #047857, #10b981); }
.iwcalc-f-lime    { background: linear-gradient(135deg, #3f6212, #65a30d); }
.iwcalc-f-sky     { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.iwcalc-f-purple  { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }

/* BMI */
.iwcalc-bmi-section { margin-bottom: 20px; }
.iwcalc-bmi-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; }
.iwcalc-bmi-score-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.iwcalc-bmi-score { font-size: 2.8rem; font-weight: 900; color: #1a7a54; line-height: 1; }
.iwcalc-bmi-category { font-size: 1rem; font-weight: 700; color: #374151; }
.iwcalc-bmi-track { display: flex; border-radius: 8px; overflow: hidden; height: 34px; }
.iwcalc-bmi-seg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: #fff; padding: 2px; text-align: center; line-height: 1.2; }
.iwcalc-bmi-under  { background: #38bdf8; }
.iwcalc-bmi-normal { background: #22c55e; }
.iwcalc-bmi-over   { background: #f59e0b; }
.iwcalc-bmi-obese  { background: #ef4444; }
.iwcalc-bmi-pointer-wrap { position: relative; height: 14px; }
.iwcalc-bmi-needle {
  position: absolute;
  top: 0;
  width: 3px;
  height: 14px;
  background: #1e293b;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.5s ease;
}

/* Status Banner */
.iwcalc-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.iwcalc-status-icon { font-size: 1.4rem; }
.iwcalc-status-text { font-size: 0.88rem; font-weight: 600; color: #166534; }
.iwcalc-status-warn { background: #fffbeb; border-color: #fde68a; }
.iwcalc-status-warn .iwcalc-status-text { color: #92400e; }
.iwcalc-status-danger { background: #fef2f2; border-color: #fecaca; }
.iwcalc-status-danger .iwcalc-status-text { color: #991b1b; }

/* Reset */
.iwcalc-reset-row { text-align: center; }
.iwcalc-reset-btn {
  padding: 9px 22px;
  background: transparent;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.iwcalc-reset-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }

/* Admin */
.iwcalc-admin-wrap { max-width: 860px; }
.iwcalc-admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 28px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); margin-top: 16px; }
.iwcalc-shortcode-info { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-top: 24px; }
.iwcalc-shortcode-info h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.iwcalc-shortcode-info h4 { font-size: 0.88rem; font-weight: 700; color: #374151; margin: 14px 0 8px; }
.iwcalc-shortcode-info code { display: block; background: #1e293b; color: #6ee7b7; padding: 8px 14px; border-radius: 6px; font-size: 0.82rem; margin-bottom: 6px; font-family: 'Courier New', monospace; }
