/* ======================================================
   Moraine Formation Language Placement Test — White Minimalist Theme
   Based on UI-SPEC.md design tokens
   ====================================================== */

/* --- Typography --- */
body {
    font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #333333;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: #212529;
}

h1 { font-size: 32px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

/* --- Container --- */
.container {
    max-width: 100%;
}

@media (min-width: 768px) {
    .container {
        max-width: 90%;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1280px;
    }
}

/* --- Cards --- */
.card {
    background-color: #F8F9FA;
    border: none;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

/* --- Primary Buttons --- */
.btn-primary {
    background-color: #2E7D32;
    color: #FFFFFF;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1B5E20;
}

.btn-primary:active {
    background-color: #1B5E20;
}

.btn-primary:disabled {
    background-color: #A5D6A7;
    cursor: not-allowed;
}

/* --- Secondary Buttons --- */
.btn-secondary {
    background-color: #F8F9FA;
    color: #333333;
    border: 1px solid #dee2e6;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* --- Form Inputs --- */
.form-control {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.form-control:focus {
    border-color: #2E7D32;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #495057;
}

/* --- Error States --- */
.has-error .form-control {
    border-color: #DC3545;
}

.has-error .help-block {
    color: #DC3545;
    font-size: 14px;
}

.text-danger {
    color: #DC3545;
}

/* --- Alerts --- */
.alert-danger {
    background-color: #F8D7DA;
    border: 1px solid #F5C6CB;
    color: #721C24;
    border-radius: 4px;
    padding: 12px 16px;
}

.alert-success {
    background-color: #D4EDDA;
    border: 1px solid #C3E6CB;
    color: #155724;
    border-radius: 4px;
    padding: 12px 16px;
}

/* --- Header --- */
header {
    min-height: 60px;
}

header h1 {
    letter-spacing: 0.5px;
}

/* --- Footer --- */
footer {
    font-size: 14px;
}

/* --- Links --- */
a {
    color: #2E7D32;
    text-decoration: none;
}

a:hover {
    color: #1B5E20;
    text-decoration: underline;
}

/* --- Progress Indicator --- */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: #2E7D32;
    border-radius: 4px;
}

/* --- Timer --- */
.timer {
    font-size: 18px;
    font-weight: 600;
    color: #2E7D32;
}

.timer-warning {
    color: #DC3545;
}

/* --- Radio & Checkbox --- */
/* Unchecked state — darker border for visibility */
.form-check-input {
    border: 2px solid #6C757D;
    background-color: #FFFFFF;
    cursor: pointer;
}

/* Larger touch area for checkboxes/radios in general */
.form-check {
    cursor: pointer;
}

/* Checked state */
.form-check-input:checked {
    background-color: #2E7D32;
    border-color: #2E7D32;
}

/* Hover state */
.form-check-input:hover:not(:disabled) {
    border-color: #2E7D32;
    box-shadow: 0 0 0 0.15rem rgba(46, 125, 50, 0.15);
}

/* Focus state */
.form-check-input:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Disabled state */
.form-check-input:disabled {
    border-color: #DEE2E6;
    opacity: 0.65;
}

/* Fix Bootstrap 5 default inconsistency for radio outer ring when checked */
.form-check-input:checked[type=radio] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input:checked[type=checkbox] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

/* --- Question Groups --- */
.question-group {
    margin-bottom: 32px;
}

.question-group h3 {
    color: #2E7D32;
    border-bottom: 2px solid #2E7D32;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.question-item {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #F8F9FA;
    border-radius: 8px;
}

.question-item .question-text {
    font-weight: 500;
    margin-bottom: 12px;
}

/* --- Language Cards --- */
.lang-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 24px;
    text-align: center;
}

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

.lang-card .lang-name {
    font-size: 20px;
    font-weight: 600;
    color: #2E7D32;
}

.lang-card .lang-level {
    font-size: 14px;
    color: #6c757d;
}

/* --- Confirmation Page --- */
.confirmation-icon {
    font-size: 64px;
    color: #2E7D32;
    margin-bottom: 16px;
}

/* --- Utility Classes --- */
.text-accent {
    color: #2E7D32;
}

.bg-light-gray {
    background-color: #F8F9FA;
}

/* --- Responsive --- */
/* --- Test Cards (Landing Page) --- */
.test-card {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    cursor: pointer;
}
.test-card:hover {
    background-color: #F8F9FA !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}
.language-selector select {
    min-width: 130px;
}

/* --- Registration Form --- */
.registration-form .form-control:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}
.registration-form .form-control.is-invalid {
    border-color: #DC3545;
}
.registration-form .invalid-feedback {
    color: #DC3545;
    font-size: 14px;
    font-weight: 400;
}
.submit-btn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}
.submit-btn:not(:disabled) {
    background-color: #2E7D32;
    border-color: #2E7D32;
}
.submit-btn:not(:disabled):hover {
    background-color: #1b5e20;
    border-color: #1b5e20;
}
#gdpr-consent:checked + label {
    color: #2E7D32;
}

/* --- Self-assessment Form --- */
.self-assessment-form .level-option {
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}
.self-assessment-form .level-option .form-check {
    cursor: pointer;
}
.self-assessment-form .degree-options .form-check {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}
.self-assessment-form .degree-options .form-check:hover {
    background-color: #E8F5E9;
}
.self-assessment-form .degree-options .form-check:has(input:checked) {
    background-color: #E8F5E9;
}
.self-assessment-form .level-option:hover {
    border-color: #2E7D32;
    background-color: #F8F9FA;
}
.self-assessment-form .level-option.selected {
    border-color: #2E7D32;
    background-color: #F0FFF0;
}
.self-assessment-form .form-check-input {
    border: 2px solid #6C757D;
}
.self-assessment-form .form-check-input:checked {
    background-color: #2E7D32;
    border-color: #2E7D32;
}
.self-assessment-form .form-check-input:hover:not(:disabled) {
    border-color: #2E7D32;
    box-shadow: 0 0 0 0.15rem rgba(46, 125, 50, 0.15);
}
.self-assessment-form .degree-options {
    padding-left: 8px;
}
.self-assessment-form .progress-bar {
    background-color: #2E7D32;
}

/* --- Priority Form --- */
.priorities-form .priority-table th {
    font-size: 13px;
    font-weight: 500;
    color: #6C757D;
    text-align: center;
}
.priorities-form .priority-table td {
    padding: 8px 4px;
    vertical-align: middle;
}
.priorities-form .priority-table .form-check-input {
    margin: 0 auto;
    display: block;
}
.priorities-form .priority-table tbody tr:hover {
    background-color: #F8F9FA;
}
.priorities-form .card {
    border-radius: 8px;
}

/* --- Questionnaire --- */
.site-questionnaire .timer-bar {
    z-index: 1030;
}
.site-questionnaire .question-item {
    padding-left: 4px;
}
.site-questionnaire .question-item:not(:last-child) {
    border-bottom: 1px solid #F0F0F0;
    padding-bottom: 16px;
}
.site-questionnaire .form-check-input {
    border: 2px solid #6C757D;
}
.site-questionnaire .form-check-input:checked {
    background-color: #2E7D32;
    border-color: #2E7D32;
}
.site-questionnaire .form-check-input:hover:not(:disabled) {
    border-color: #2E7D32;
    box-shadow: 0 0 0 0.15rem rgba(46, 125, 50, 0.15);
}
.site-questionnaire .form-check-label {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}
.site-questionnaire .form-check-label:hover {
    background-color: #F0FFF0;
}

/* --- Confirmation / Expired --- */
.site-confirmation .card,
.site-expired .card {
    border-radius: 12px;
}

/* --- Responsive --- */
@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 12px 16px;
    }

    .card {
        padding: 12px;
    }

    /* Ensure tap targets are at least 44px */
    .btn,
    .form-control,
    .form-check-input {
        min-height: 44px;
    }
}
