/*
 * System Formy – Kalkulatory
 * Wspólny arkusz stylów dla wszystkich kalkulatorów wtyczki.
 *
 * Paleta i typografia zgodna z page-css-reference.css strony SystemFormy.pl:
 *   – Tło strony:          #FBFBFA
 *   – Kolor akcentu:       #3B434D  (hover: #606A75)
 *   – Tekst główny:        #111111
 *   – Czcionka:            "Helvetica Neue", Helvetica, Arial, sans-serif
 *   – Zaokrąglenia:        10-12px  (zgodnie z istniejącymi buttonami i inputami na stronie)
 *
 * Wszystkie reguły są w zasięgu .sf-calc, aby unikać konfliktów z motywem.
 */

/* ======================================================
   1. Kontener kalkulatora
   ====================================================== */

.sf-calc {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #111111;
    margin: 1.5rem 0 2rem;
}

/* ======================================================
   2. Karta – główny wrapper formularza
   ====================================================== */

.sf-calc__card {
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 14px;
    padding: 28px 32px;
    max-width: 680px;
}

@media (max-width: 600px) {
    .sf-calc__card {
        padding: 20px 18px;
    }
}

/* ======================================================
   3. Tytuł i opis kalkulatora
   ====================================================== */

.sf-calc__title {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #111111;
    margin: 0 0 6px;
}

.sf-calc__subtitle {
    font-size: 0.92rem;
    color: #3B434D;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ======================================================
   4. Siatka pól formularza
   ====================================================== */

.sf-calc__row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.sf-calc__col {
    flex: 1 1 220px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.sf-calc__col--full {
    flex: 1 1 100%;
}

/* ======================================================
   5. Etykiety
   ====================================================== */

.sf-calc label,
.sf-calc__label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #3B434D;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* ======================================================
   6. Pola tekstowe, liczby, select
   ====================================================== */

.sf-calc input[type="number"],
.sf-calc input[type="text"],
.sf-calc select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #DADADA;
    border-radius: 10px;
    background: #FFFFFF;
    color: #111111;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    -moz-appearance: textfield;   /* ukryj strzałki w FF */
    appearance: auto;
}

.sf-calc input[type="number"]::-webkit-outer-spin-button,
.sf-calc input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sf-calc input[type="number"]:focus,
.sf-calc input[type="text"]:focus,
.sf-calc select:focus {
    border-color: #3B434D;
    box-shadow: 0 0 0 4px rgba(59, 67, 77, 0.12);
    outline: none;
}

/* ======================================================
   7. Płeć – radio-buttons jako przyciski toggle
   ====================================================== */

.sf-calc__gender-group {
    display: flex;
    gap: 10px;
}

.sf-calc__gender-group input[type="radio"] {
    display: none;
}

.sf-calc__gender-group label {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #DADADA;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3B434D;
    background: #FFFFFF;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    margin-bottom: 0;
    letter-spacing: 0;
}

.sf-calc__gender-group input[type="radio"]:checked + label {
    background-color: #3B434D;
    border-color: #3B434D;
    color: #FFFFFF;
}

.sf-calc__gender-group label:hover {
    border-color: #606A75;
    color: #606A75;
}

.sf-calc__gender-group input[type="radio"]:checked + label:hover {
    background-color: #606A75;
    border-color: #606A75;
    color: #FFFFFF;
}

/* ======================================================
   8. Przycisk oblicz
   ====================================================== */

.sf-calc__btn {
    display: inline-block;
    width: 100%;
    padding: 13px 20px;
    margin-top: 8px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    background-color: #3B434D;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 150ms ease, transform 120ms ease;
    letter-spacing: 0.01em;
}

.sf-calc__btn:hover {
    background-color: #606A75;
    transform: translateY(-1px);
}

.sf-calc__btn:active {
    transform: translateY(0);
}

/* ======================================================
   9. Wyniki
   ====================================================== */

.sf-calc__results {
    margin-top: 28px;
    display: none;           /* pokazywane przez JS po obliczeniu */
}

.sf-calc__results.is-visible {
    display: block;
}

/* Główny wskaźnik BMI */
.sf-calc__result-main {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 6px solid #3B434D;
    background: #F7F8F9;
}

.sf-calc__result-value {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: #111111;
    white-space: nowrap;
}

.sf-calc__result-value span {
    font-size: 1rem;
    font-weight: 400;
    color: #606A75;
    margin-left: 4px;
}

.sf-calc__result-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111111;
}

.sf-calc__result-category {
    font-size: 0.9rem;
    color: #606A75;
    margin-top: 2px;
}

/* Kolory wg kategorii BMI */
.sf-calc__result-main.bmi-underweight  { border-color: #5C9BD1; background: #EFF5FB; }
.sf-calc__result-main.bmi-normal       { border-color: #4CAF7D; background: #EDF7F1; }
.sf-calc__result-main.bmi-overweight   { border-color: #F0A500; background: #FEF8EC; }
.sf-calc__result-main.bmi-obese-1      { border-color: #E07040; background: #FDF1EB; }
.sf-calc__result-main.bmi-obese-2      { border-color: #D94F4F; background: #FCF0F0; }
.sf-calc__result-main.bmi-obese-3      { border-color: #A83232; background: #F9E8E8; }

/* Tabela szczegółów */
.sf-calc__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.sf-calc__detail-item {
    background: #FAFAFA;
    border: 1px solid #EAEAEA;
    border-radius: 10px;
    padding: 14px 16px;
}

.sf-calc__detail-name {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #606A75;
    margin-bottom: 4px;
}

.sf-calc__detail-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111111;
}

.sf-calc__detail-value em {
    font-style: normal;
    color: #606A75;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Pasek wizualny BMI */
.sf-calc__bmi-scale {
    margin-bottom: 20px;
}

.sf-calc__bmi-scale-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #606A75;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.sf-calc__bmi-bar-wrap {
    position: relative;
    height: 14px;
    border-radius: 7px;
    overflow: visible;
    background: linear-gradient(
        to right,
        #5C9BD1  0%,         /* niedowaga  < 18.5  → 0–37%   */
        #5C9BD1 37%,
        #4CAF7D 37%,         /* norma      18.5–25 → 37–50%  */
        #4CAF7D 50%,
        #F0A500 50%,         /* nadwaga    25–30   → 50–60%  */
        #F0A500 60%,
        #E07040 60%,         /* otyłość I  30–35   → 60–70%  */
        #E07040 70%,
        #D94F4F 70%,         /* otyłość II 35–40   → 70–80%  */
        #D94F4F 80%,
        #A83232 80%,         /* otyłość III >40    → 80–100% */
        #A83232 100%
    );
    /* Skala paska: 0–50 kg/m²; progi = wartość/50*100 */
}

.sf-calc__bmi-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border: 3px solid #111111;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: left 400ms cubic-bezier(.4,0,.2,1);
}

.sf-calc__bmi-bar-ticks {
    position: relative;
    height: 18px;
    margin-top: 5px;
    font-size: 0.72rem;
    color: #606A75;
}

.sf-calc__bmi-bar-ticks span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Pozycje progów: wartość / 50 * 100% */
.sf-calc__bmi-bar-ticks span:nth-child(1) { left: 0%;   transform: none; }        /* 0    */
.sf-calc__bmi-bar-ticks span:nth-child(2) { left: 37%;  }  /* 18,5 */
.sf-calc__bmi-bar-ticks span:nth-child(3) { left: 50%;  }  /* 25   */
.sf-calc__bmi-bar-ticks span:nth-child(4) { left: 60%;  }  /* 30   */
.sf-calc__bmi-bar-ticks span:nth-child(5) { left: 100%; transform: translateX(-100%); } /* 50 */

/* Wskazówka/porada */
.sf-calc__tip {
    margin-top: 20px;
    padding: 14px 18px;
    background: #F7F8F9;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #3B434D;
    line-height: 1.6;
    border-left: 4px solid #EAEAEA;
}

.sf-calc__tip strong {
    color: #111111;
}

/* Przycisk reset */
.sf-calc__btn-reset {
    display: inline-block;
    margin-top: 14px;
    padding: 9px 18px;
    background: transparent;
    border: 1px solid #DADADA;
    border-radius: 10px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3B434D;
    cursor: pointer;
    transition: border-color 150ms, color 150ms;
}

.sf-calc__btn-reset:hover {
    border-color: #3B434D;
    color: #111111;
}

/* ======================================================
   10. Ostrzeżenie / disclaimer
   ====================================================== */

.sf-calc__disclaimer {
    margin-top: 24px;
    font-size: 0.78rem;
    color: #909090;
    line-height: 1.55;
    max-width: 680px;
}

/* ======================================================
   11. Responsywność
   ====================================================== */

@media (max-width: 480px) {
    .sf-calc__result-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sf-calc__result-value {
        font-size: 2.2rem;
    }

    .sf-calc__details {
        grid-template-columns: 1fr;
    }
}
