/* ===========================================
   IDEAL BODY WEIGHT CALCULATOR - SKY BLUE THEME
   Primary: #0284c7 | Gradient to: #0369a1
   =========================================== */

/* ---- CONTAINER ---- */
.ibw-calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.ibw-calculator-container *,
.ibw-calculator-container *::before,
.ibw-calculator-container *::after {
    box-sizing: border-box;
}

/* ---- HERO ---- */
.ibw-hero {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    text-align: center;
    padding: 48px 32px 40px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.ibw-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 10px;
    line-height: 1.2;
}

.ibw-hero .hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.92;
    margin: 0 0 20px;
    font-weight: 400;
}

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-icon {
    font-size: 0.95rem;
}

/* ---- STATS ROW ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0284c7;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 500;
}

/* ---- PRIVACY NOTICE ---- */
.privacy-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0284c7;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 28px;
    font-size: 0.9rem;
    color: #334155;
}

/* ---- FORM SECTION ---- */
.calculator-form-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 32px 28px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 8px;
    margin-bottom: 0;
}

/* ---- RADIO TOGGLE ---- */
.radio-toggle {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    max-width: 320px;
}

.toggle-btn {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.toggle-btn input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-btn span {
    display: block;
    text-align: center;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    background: #f8fafc;
    transition: all 0.2s ease;
    border-right: 1px solid #e2e8f0;
}

.toggle-btn:last-child span {
    border-right: none;
}

.toggle-btn input:checked + span {
    background: #0284c7;
    color: #fff;
}

.toggle-btn:hover span {
    background: #e0f2fe;
}

.toggle-btn input:checked + span:hover {
    background: #0369a1;
}

/* ---- UNIT TOGGLE ---- */
.unit-toggle-wrapper {
    margin-bottom: 14px;
}

.unit-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.unit-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn + .unit-btn {
    border-left: 1px solid #e2e8f0;
}

.unit-btn.active {
    background: #0284c7;
    color: #fff;
}

.unit-btn:hover:not(.active) {
    background: #e0f2fe;
}

/* ---- HEIGHT INPUTS ---- */
.height-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.height-field {
    flex: 1;
    position: relative;
}

.height-field.full-width {
    max-width: 260px;
    position: relative;
}

.height-field select,
.height-field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.height-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.height-field input:focus,
.height-field select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
}

.height-field input[type="number"] {
    padding-right: 44px;
}

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

.height-field input[type="number"] {
    -moz-appearance: textfield;
}

/* ---- SUBMIT BUTTON ---- */
.form-submit {
    text-align: center;
    margin-top: 8px;
}

.submit-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    border: none;
    padding: 14px 48px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ---- ERROR MESSAGE ---- */
.ibw-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---- RESULTS SECTION ---- */
.results-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 36px 28px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.results-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0c4a6e;
    margin: 0 0 28px;
}

/* ---- FORMULA RESULT CARDS (4-column grid) ---- */
.formula-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.formula-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 14px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.formula-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.formula-card-primary {
    background: #f0f9ff;
    border-color: #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.formula-card-header {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.formula-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.formula-year {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.formula-card-badge {
    display: inline-block;
    background: #0284c7;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.formula-card-result {
    margin-bottom: 4px;
}

.result-lbs {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0284c7;
}

.result-unit {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-left: 3px;
}

.formula-card-kg {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* ---- AVERAGE RESULT CARD ---- */
.average-result-card {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.average-result-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px;
    opacity: 0.9;
}

.average-result-values {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.average-lbs,
.average-kg {
    font-size: 2rem;
    font-weight: 800;
}

.average-unit {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.85;
}

.average-divider {
    font-size: 1.2rem;
    opacity: 0.5;
    margin: 0 4px;
}

/* ---- BMI RANGE CARD ---- */
.bmi-range-card {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 22px 24px;
    text-align: center;
    margin-bottom: 28px;
}

.bmi-range-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #166534;
    margin: 0 0 4px;
}

.bmi-range-subtitle {
    font-size: 0.82rem;
    color: #4ade80;
    margin: 0 0 12px;
    font-weight: 500;
}

.bmi-range-values {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bmi-range-lbs,
.bmi-range-kg {
    font-size: 1.15rem;
    font-weight: 700;
    color: #15803d;
}

.bmi-range-divider {
    color: #86efac;
    font-weight: 300;
}

/* ---- COMPARISON CHART ---- */
.comparison-chart-section {
    margin-bottom: 28px;
}

.comparison-chart-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
    text-align: center;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.chart-bar-row-average {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 2px dashed #e2e8f0;
}

.chart-label {
    width: 120px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-align: right;
    flex-shrink: 0;
}

.chart-bar-track {
    flex: 1;
    background: #f1f5f9;
    border-radius: 6px;
    height: 28px;
    overflow: hidden;
    position: relative;
}

.chart-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    min-width: 0;
}

.chart-bar-devine {
    background: linear-gradient(90deg, #0284c7, #0ea5e9);
}

.chart-bar-robinson {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.chart-bar-miller {
    background: linear-gradient(90deg, #059669, #34d399);
}

.chart-bar-hamwi {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.chart-bar-average {
    background: linear-gradient(90deg, #0369a1, #0284c7);
    border: 2px solid #0c4a6e;
}

.chart-value {
    width: 65px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    flex-shrink: 0;
}

/* ---- ACTION BUTTONS ---- */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 28px 0 20px;
    flex-wrap: wrap;
}

.mdcv2-print-btn,
.mdcv2-share-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mdcv2-print-btn:hover,
.mdcv2-share-btn:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
}

/* ---- HISTORY ---- */
.mdcv2-history-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    margin-top: 20px;
}

.mdcv2-history-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.history-date {
    color: #64748b;
    font-weight: 500;
}

.history-result {
    color: #0284c7;
    font-weight: 600;
}

.mdcv2-clear-history {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 6px;
}

.mdcv2-clear-history:hover {
    text-decoration: underline;
}

/* ---- RETAKE ---- */
.retake-wrapper {
    text-align: center;
    margin-top: 24px;
}

.retake-btn {
    background: #fff;
    border: 2px solid #0284c7;
    color: #0284c7;
    padding: 12px 36px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retake-btn:hover {
    background: #0284c7;
    color: #fff;
}

/* ---- EDUCATION TABS ---- */
.education-tabs {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #0284c7;
    background: #f0f9ff;
}

.tab-btn.active {
    color: #0284c7;
    background: #fff;
    border-bottom-color: #0284c7;
}

.tab-content {
    display: none;
    padding: 28px 24px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0c4a6e;
    margin: 0 0 14px;
}

.tab-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 20px 0 8px;
}

.tab-content p {
    font-size: 0.92rem;
    color: #334155;
    margin: 0 0 12px;
}

.tab-content ul,
.tab-content ol {
    padding-left: 20px;
    margin: 0 0 14px;
}

.tab-content li {
    font-size: 0.92rem;
    color: #334155;
    margin-bottom: 6px;
    line-height: 1.55;
}

/* ---- FAQ ACCORDION ---- */
.faq-section {
    margin-bottom: 28px;
}

.faq-section h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 18px;
    text-align: center;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.faq-question::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 400;
    color: #0284c7;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
    content: "\2212";
}

.faq-question:hover {
    background: #f0f9ff;
}

.faq-answer {
    display: none;
    padding: 0 20px 16px;
    background: #fff;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-answer p {
    font-size: 0.9rem;
    color: #475569;
    margin: 12px 0 0;
    line-height: 1.6;
}

/* ---- MEDICAL DISCLAIMER ---- */
.medical-disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.medical-disclaimer h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 8px;
}

.medical-disclaimer p {
    font-size: 0.85rem;
    color: #78350f;
    margin: 0;
    line-height: 1.6;
}

/* ---- RELATED CALCULATORS ---- */
.related-calculators {
    margin-bottom: 28px;
}

.related-calculators h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 18px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.related-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-card:hover {
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
    transform: translateY(-2px);
}

.related-card h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0284c7;
    margin: 0 0 6px;
}

.related-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

/* ---- REFERENCES ---- */
.references-section {
    margin-bottom: 16px;
}

.references-section h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 14px;
}

.references-section ol {
    padding-left: 20px;
    margin: 0;
}

.references-section li {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.5;
}

.references-section em {
    font-style: italic;
}

.references-section a {
    color: #0284c7;
    text-decoration: none;
}

.references-section a:hover {
    text-decoration: underline;
}

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

@media (max-width: 768px) {
    .ibw-hero {
        padding: 32px 20px 28px;
    }

    .ibw-hero h1 {
        font-size: 1.5rem;
    }

    .ibw-hero .hero-subtitle {
        font-size: 0.92rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .calculator-form-section {
        padding: 24px 18px;
    }

    .formula-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .results-section {
        padding: 28px 18px;
    }

    .chart-label {
        width: 90px;
        font-size: 0.75rem;
    }

    .chart-value {
        width: 55px;
        font-size: 0.75rem;
    }

    .tab-nav {
        flex-wrap: nowrap;
    }

    .tab-btn {
        font-size: 0.78rem;
        padding: 12px 10px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .average-lbs,
    .average-kg {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .ibw-calculator-container {
        padding: 0 10px;
    }

    .ibw-hero {
        padding: 24px 16px 22px;
        border-radius: 12px;
    }

    .ibw-hero h1 {
        font-size: 1.3rem;
    }

    .hero-badges {
        gap: 6px;
    }

    .badge {
        font-size: 0.78rem;
        padding: 5px 12px;
    }

    .formula-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .formula-card {
        padding: 16px 10px;
    }

    .result-lbs {
        font-size: 1.35rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .mdcv2-print-btn,
    .mdcv2-share-btn {
        width: 100%;
        max-width: 280px;
    }
}
