/**
 * Kalkulator WHR — structural layout.
 */

/* ── Form ── */

.whr-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-l, 2rem);
}

/* ── Inputs grid ── */

.whr-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-m, 1.25rem);
}

.whr-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs, 0.25rem);
}

.whr-label {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    color: var(--heading-color, #1a1a1a);
}

.whr-field input[type="number"] {
    padding: var(--space-xs, 0.5rem) var(--space-s, 0.75rem);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-md, 8px);
    font-size: var(--font-size-lg, 1.125rem);
    background: var(--surface, #fff);
    color: var(--text-primary, #1a1a1a);
    transition: border-color 0.15s;
}

.whr-field input[type="number"]:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Gender radio pills ── */

.whr-gender {
    border: none;
    padding: 0;
    margin: 0;
    grid-column: 1 / -1;
}

.whr-gender legend {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    color: var(--heading-color, #1a1a1a);
    margin-bottom: var(--space-xs, 0.25rem);
}

.whr-radio-group {
    display: flex;
    gap: var(--space-xs, 0.35rem);
}

.whr-radio {
    flex: 1;
    cursor: pointer;
}

.whr-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.whr-radio span {
    display: block;
    text-align: center;
    padding: var(--space-xs, 0.5rem) var(--space-s, 0.75rem);
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: var(--radius-md, 8px);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-primary, #374151);
    background: var(--surface, #fff);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.whr-radio input:checked + span {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
    color: #fff;
}

.whr-radio input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* ── Measurement guide ── */

.whr-guide {
    padding: var(--space-s, 0.75rem) var(--space-m, 1rem);
    background: var(--surface-alt, #f9fafb);
    border-radius: var(--radius-md, 8px);
    border-left: 3px solid var(--border-color, #d1d5db);
}

.whr-guide-text {
    margin: 0;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.whr-guide-text strong {
    color: var(--heading-color, #1a1a1a);
}

/* ── Result panel ── */

.whr-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-m, 1.25rem);
    padding: var(--space-l, 2rem);
    background: var(--surface-alt, #f9fafb);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border-color, #e5e7eb);
}

.whr-result-score {
    text-align: center;
}

.whr-result-label {
    display: block;
    font-size: var(--font-size-xs, 0.75rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: var(--space-xs, 0.15rem);
}

.whr-result-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--heading-color, #111827);
}

/* ── Risk badge ── */

.whr-badge {
    display: inline-block;
    padding: var(--space-xs, 0.3rem) var(--space-m, 1rem);
    border-radius: 999px;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.whr-cat-niskie .whr-badge {
    background: #dcfce7;
    color: #166534;
}

.whr-cat-umiarkowane .whr-badge {
    background: #fef9c3;
    color: #854d0e;
}

.whr-cat-wysokie .whr-badge {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Body type ── */

.whr-result-body-type {
    font-size: var(--font-size-base, 1rem);
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

/* ── Scale bar ── */

.whr-scale {
    width: 100%;
    max-width: 400px;
}

.whr-scale-bar {
    position: relative;
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: visible;
}

.whr-scale-zone {
    flex: 1;
}

.whr-scale-low      { background: #86efac; border-radius: 6px 0 0 6px; }
.whr-scale-moderate  { background: #fde68a; }
.whr-scale-high      { background: #fca5a5; border-radius: 0 6px 6px 0; }

.whr-scale-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 20px;
    background: var(--heading-color, #1f2937);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    left: 0;
}

.whr-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs, 0.25rem);
    font-size: var(--font-size-xs, 0.7rem);
    color: var(--text-secondary, #9ca3af);
}

/* ── Info cards ── */

.whr-info {
    width: 100%;
}

.whr-info-card {
    padding: var(--space-m, 1rem);
    border-radius: var(--radius-md, 8px);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.6;
}

.whr-info-card strong {
    display: block;
    margin-bottom: var(--space-xs, 0.25rem);
}

.whr-info-card p {
    margin: 0;
    color: var(--text-primary, #374151);
}

.whr-info-niskie      { background: #f0fdf4; border-left: 4px solid #22c55e; }
.whr-info-umiarkowane { background: #fefce8; border-left: 4px solid #eab308; }
.whr-info-wysokie     { background: #fef2f2; border-left: 4px solid #ef4444; }

/* ── Responsive ── */

@media (max-width: 500px) {
    .whr-inputs {
        grid-template-columns: 1fr;
    }
}
