/* Risk Calculator Styles */

/* Contributing factors display */
.contributing-factors {
    margin-top: 15px;
    padding: 15px;
    background-color: #f5f3ff;
    border-radius: 8px;
    font-size: 14px;
}

.contributing-factors h4 {
    margin: 0 0 10px 0;
    color: #6b46c1;
    font-size: 16px;
    font-weight: 600;
}

.contributing-factors ul {
    margin: 0;
    padding-left: 20px;
}

.contributing-factors li {
    margin-bottom: 5px;
    color: #4c4c4c;
}

/* Risk recommendation links */
.risk-recommendation a {
    color: #8b5cf6;
    font-weight: 600;
    text-decoration: underline;
}

.risk-recommendation a:hover {
    color: #6b46c1;
}

.calculator-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.calculator-container h1 {
    color: #8b5cf6;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Form Sections */
.form-section {
    background: #f8f6ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h2 {
    color: #8b5cf6;
    font-size: 20px;
    margin-bottom: 15px;
}

.section-note {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Height inputs */
.height-inputs {
    display: flex;
    gap: 10px;
}

.height-inputs input {
    flex: 1;
}

/* Checkbox groups */
.checkbox-group {
    margin-bottom: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-group label:hover {
    background: #f0ebff;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* When checkbox is checked, highlight the whole label */
.checkbox-group input[type="checkbox"]:checked + span,
.checkbox-group label:has(input:checked) {
    background: #f0ebff;
    color: #8b5cf6;
    font-weight: 600;
}

/* Submit button */
.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    margin-top: 20px;
}

/* Results Section */
.results-section {
    margin-top: 40px;
}

.results-section h2 {
    text-align: center;
    color: #8b5cf6;
    margin-bottom: 30px;
}

/* Risk Cards */
.risk-card {
    background: #fff;
    border: 2px solid #f0ebff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.risk-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.risk-percentage {
    font-size: 48px;
    font-weight: bold;
    color: #8b5cf6;
    margin-bottom: 10px;
}

.risk-category {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* Risk category colors */
.risk-low {
    background: #e6f7e6;
    color: #28a745;
}

.risk-moderate {
    background: #fff3cd;
    color: #856404;
}

.risk-high {
    background: #f8d7da;
    color: #721c24;
}

.risk-very-high {
    background: #721c24;
    color: #fff;
}

.risk-recommendation {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
}

/* Weight Projection Card */
.weight-projection-card {
    background: #8b5cf6;
    color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.weight-projection-card h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 24px;
}

.weight-stats {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 20px;
}

.weight-stat {
    flex: 1;
}

.weight-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.weight-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
}

.weight-stat.projected .weight-value {
    font-size: 40px;
}

.weight-recommendation {
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.95;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Risk comparison section */
.risk-comparison {
    background: #f8f6ff;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.comparison-item {
    text-align: center;
}

.comparison-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.comparison-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #8b5cf6;
}

/* Error states */
.form-group.error input,
.form-group.error select {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* Loading state */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .form-section {
        padding: 15px;
    }
    
    .risk-percentage {
        font-size: 36px;
    }
}