/* =====================================================
   CALCULATOR WIZARD — TA Nutrition
   ===================================================== */

:root {
    --cw-primary: #467f6d;
    --cw-primary-dark: #046e4c;
    --cw-text: #37474f;
    --cw-text-light: #607d8b;
    --cw-bg: #ffffff;
    --cw-bg-soft: #f5f7f6;
    --cw-border: #e0e0e0;
    --cw-error: #e53935;
    --cw-prot: #124660;
    --cw-lip: #e53935;
    --cw-carb: #f99b46;
    --cw-sugar: #ab47bc;
    --cw-fibre: #66bb6a;
    --cw-radius: 16px;
    --cw-radius-sm: 10px;
    --cw-shadow: 0 2px 12px rgba(0,0,0,.06);
    --cw-gradient: linear-gradient(135deg, var(--cw-primary), var(--cw-primary-dark));
}

/* ===== ACCENT ===== */
.cw-accent { color: var(--cw-primary); }

/* ===== WIZARD CONTAINER ===== */
#cw-wizard {
    max-width: 720px;
    margin: 0 auto 40px;
    padding: 0 16px;
}

/* ===== PROGRESS BAR ===== */
#cw-progress {
    margin-bottom: 40px;
}
#cw-progress-bar {
    height: 4px;
    background: var(--cw-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}
#cw-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--cw-gradient);
    border-radius: 4px;
    transition: width .4s ease;
}
#cw-progress-steps {
    display: flex;
    justify-content: space-between;
}
.cw-pstep {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-text-light);
    background: var(--cw-bg-soft);
    border: 2px solid var(--cw-border);
    transition: all .3s ease;
}
.cw-pstep.active {
    color: #fff;
    background: var(--cw-primary);
    border-color: var(--cw-primary);
    transform: scale(1.15);
}
.cw-pstep.done {
    color: #fff;
    background: var(--cw-primary-dark);
    border-color: var(--cw-primary-dark);
}

/* ===== STEPS ===== */
.cw-step {
    display: none;
    animation: cwFadeIn .35s ease;
}
.cw-step.active { display: block; }

@keyframes cwFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== TITLES ===== */
.cw-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--cw-text);
    text-align: center;
    margin-bottom: 32px;
}

/* ===== FIELD GROUPS ===== */
.cw-field-group {
    margin-bottom: 28px;
}
.cw-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--cw-text);
    margin-bottom: 12px;
}

/* ===== NUMBER INPUTS ===== */
.cw-input-unit {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}
.cw-input-unit input {
    width: 90px;
    background: none;
    border: none;
    border-bottom: 2px solid var(--cw-primary);
    font-size: 32px;
    font-weight: 700;
    color: var(--cw-primary-dark);
    text-align: center;
    padding: 4px 0;
    outline: none;
    transition: border-color .2s;
}
.cw-input-unit input:focus {
    border-bottom-color: var(--cw-primary-dark);
}
.cw-input-unit input::placeholder {
    color: #ccc;
}
.cw-unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--cw-text-light);
}

/* row of inputs */
.cw-fields-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.cw-fields-row .cw-field-group {
    text-align: center;
}

/* ===== CHOICES (generic) ===== */
.cw-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.cw-choice {
    cursor: pointer;
    border: 2px solid var(--cw-border);
    border-radius: var(--cw-radius-sm);
    padding: 14px 20px;
    text-align: center;
    transition: all .2s ease;
    background: var(--cw-bg);
    color: var(--cw-text);
}
.cw-choice:hover {
    border-color: var(--cw-primary);
    background: var(--cw-bg-soft);
}
.cw-choice.selected {
    border-color: var(--cw-primary);
    background: var(--cw-gradient);
    color: #fff;
    box-shadow: var(--cw-shadow);
}
.cw-choice.selected small {
    color: rgba(255,255,255,.8);
}
.cw-choice img {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 8px;
}

/* 2-col choices (gender) */
.cw-choices--2 .cw-choice {
    width: 140px;
}

/* 3-col cards */
.cw-choices--3 .cw-choice {
    width: calc(33.33% - 12px);
    min-width: 160px;
}

/* 4-col cards (objective) */
.cw-choices--4 .cw-choice {
    width: calc(25% - 12px);
    min-width: 150px;
}

/* cards style */
.cw-choices--cards .cw-choice {
    padding: 20px 16px;
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
}
.cw-choice-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.cw-choice-main {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}
.cw-choice small {
    display: block;
    font-size: 12px;
    color: var(--cw-text-light);
    line-height: 1.3;
}

/* pill choices (inline compact) */
.cw-choices--inline {
    gap: 8px;
}
.cw-choice--pill {
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
}
.cw-choice--pill span {
    white-space: nowrap;
}

/* vertical / row choices */
.cw-choices--vertical {
    flex-direction: column;
    align-items: stretch;
    max-width: 600px;
    margin: 0 auto;
}
.cw-choice--row {
    text-align: left;
    border-radius: var(--cw-radius-sm);
    padding: 14px 20px;
    font-size: 14px;
}
.cw-choice--row .cw-choice-main {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}
.cw-choice--row small {
    display: block;
    font-size: 12px;
    color: var(--cw-text-light);
    line-height: 1.3;
}
.cw-choice--row.selected small {
    color: rgba(255,255,255,.75);
}

/* ===== SPORT DETAIL (conditional) ===== */
.cw-sport-detail {
    transition: all .2s;
}

/* ===== NAVIGATION ===== */
#cw-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding: 0 4px;
}

/* ===== BUTTONS ===== */
.cw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.cw-btn--primary {
    background: var(--cw-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(70,127,109,.3);
}
.cw-btn--primary:hover {
    box-shadow: 0 6px 20px rgba(70,127,109,.4);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.cw-btn--outline {
    background: transparent;
    color: var(--cw-primary);
    border: 2px solid var(--cw-primary);
}
.cw-btn--outline:hover {
    background: var(--cw-bg-soft);
}
.cw-btn--lg {
    padding: 14px 36px;
    font-size: 16px;
}

/* ===== ERROR ===== */
#cw-error {
    background: var(--cw-error);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    margin-top: 16px;
    letter-spacing: .3px;
}

/* ===== LOADING ===== */
#cw-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--cw-text-light);
    font-size: 16px;
}
.cw-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cw-border);
    border-top-color: var(--cw-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: cwSpin .8s linear infinite;
}
@keyframes cwSpin { to { transform: rotate(360deg); } }

/* ===== RESULTS ===== */
#cw-results {
    text-align: center;
    animation: cwFadeIn .5s ease;
}
#cw-results-header {
    margin-bottom: 8px;
}
.cw-results-objective {
    font-size: 16px;
    color: var(--cw-primary);
    font-weight: 600;
}

/* kcal big number */
#cw-kcal-display {
    margin: 24px 0 32px;
}
#cw-kcal-value {
    font-size: 64px;
    font-weight: 900;
    color: var(--cw-primary-dark);
    line-height: 1;
}
#cw-kcal-unit {
    display: block;
    font-size: 18px;
    color: var(--cw-text-light);
    font-weight: 500;
    margin-top: 4px;
}

/* macros row */
#cw-macros {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.cw-macro {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--cw-shadow);
}
.cw-macro-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}
.cw-macro-label {
    font-size: 11px;
    font-weight: 500;
    opacity: .9;
}
.cw-macro--prot  { background: linear-gradient(135deg, #124660, #092c3d); }
.cw-macro--lip   { background: linear-gradient(135deg, #ff5757, #d63939); }
.cw-macro--carb  { background: linear-gradient(135deg, #f99b46, #c97225); }
.cw-macro--sugar { background: linear-gradient(135deg, #ab47bc, #7b1fa2); }
.cw-macro--fibre { background: linear-gradient(135deg, #66bb6a, #388e3c); }

/* ===== CTA SECTION ===== */
#cw-cta-section {
    margin: 0 auto 40px;
    max-width: 680px;
}
#cw-cta-card {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--cw-bg-soft);
    border: 2px solid var(--cw-border);
    border-radius: var(--cw-radius);
    padding: 32px;
    text-align: left;
}
#cw-cta-left {
    flex: 1;
}
#cw-cta-left h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--cw-text);
    margin: 0 0 8px;
}
#cw-cta-left p {
    font-size: 14px;
    color: var(--cw-text-light);
    line-height: 1.5;
    margin: 0 0 16px;
}
#cw-download-btn {
    margin-top: 8px;
}

/* slug display */
#cw-slug-display {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px dashed var(--cw-primary);
    border-radius: var(--cw-radius-sm);
    padding: 10px 20px;
    margin-bottom: 8px;
}
.cw-slug-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cw-slug-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--cw-primary-dark);
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}
.cw-slug-hint {
    font-size: 12px !important;
    color: var(--cw-text-light) !important;
    font-style: italic;
    margin-bottom: 8px !important;
}

/* copy button */
.cw-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--cw-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.cw-copy-btn:hover {
    background: var(--cw-primary-dark);
}
.cw-copy-btn svg {
    flex-shrink: 0;
}

/* QR code */
#cw-cta-right {
    text-align: center;
    flex-shrink: 0;
}
#cw-qrcode {
    background: #fff;
    padding: 10px;
    border-radius: var(--cw-radius-sm);
    box-shadow: var(--cw-shadow);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.cw-qr-caption {
    font-size: 11px;
    color: var(--cw-text-light);
    display: block;
}

/* contents section separator */
#cw-contents-section {
    text-align: center;
    margin-top: 48px;
    margin-bottom: 16px;
}
.cw-contents-divider {
    width: 80px;
    height: 3px;
    background: var(--cw-gradient);
    border-radius: 3px;
    margin: 0 auto 24px;
}
.cw-contents-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--cw-text);
    margin-bottom: 8px;
}
.cw-contents-subtitle {
    font-size: 15px;
    color: var(--cw-text-light);
    margin-bottom: 0;
}

/* restart */
#cw-restart-wrap {
    margin-top: 24px;
}

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

@media (max-width: 768px) {
    #cw-wizard { padding: 0 12px; }

    .cw-title { font-size: 22px; }

    .cw-fields-row {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .cw-choices--3 .cw-choice,
    .cw-choices--4 .cw-choice {
        width: calc(50% - 8px);
        min-width: 140px;
    }

    .cw-choices--inline {
        justify-content: center;
    }

    #cw-kcal-value { font-size: 48px; }

    #cw-macros {
        gap: 10px;
    }
    .cw-macro {
        width: 80px;
        height: 80px;
    }
    .cw-macro-value { font-size: 15px; }
    .cw-macro-label { font-size: 10px; }

    /* CTA card stacked */
    #cw-cta-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        gap: 24px;
    }
    #cw-cta-left {
        text-align: center;
    }
    #cw-slug-display {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .cw-choices--3 .cw-choice,
    .cw-choices--4 .cw-choice {
        width: 100%;
    }
    .cw-choices--2 .cw-choice {
        width: 120px;
    }
    .cw-choice--pill {
        padding: 8px 14px;
        font-size: 13px;
    }
    #cw-kcal-value { font-size: 40px; }
}
