/* ==== Reset ==== */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }

/* ==== Couleurs & typographie ==== */
:root{
    --primary:#3498db;
    --primary-dark:#2980b9;
    --bg-grad:#f0f4ff;
    --bg-card:#fff;
    --text:#333;
    --muted:#777;
    --accent:#2c3e50;
}
body{
    font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    background:linear-gradient(135deg,var(--bg-grad),#e6e9ff);
    color:var(--text);
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:2rem;
}

/* ==== Conteneur principal ==== */
.wrapper{
    max-width:900px;
    width:100%;
    background:var(--bg-card);
    border-radius:12px;
    box-shadow:0 8px 24px rgba(0,0,0,.1);
    padding:2.5rem 2rem;
}

/* ==== Titres ==== */
h1{font-size:2.2rem;margin-bottom:.5rem;color:var(--accent);}
h2{font-size:1.6rem;margin:1rem 0 .5rem;color:var(--accent);}
h3{font-size:1.3rem;margin:.5rem 0;color:var(--accent);}

/* ==== Boutons ==== */
.btn{
    display:inline-block;
    background:var(--primary);
    color:#fff;
    text-decoration:none;
    padding:.8rem 1.5rem;
    border-radius:4px;
    font-weight:600;
    cursor:pointer;
}
.btn:hover{background:var(--primary-dark);}

/* ==== Formulaires ==== */
input, select, textarea{
    width:100%;
    padding:.6rem;
    margin:.4rem 0 1rem;
    border:1px solid #ccc;
    border-radius:4px;
    font-size:1rem;
}
label{font-weight:500;}

/* ==== Card de quiz ==== */
.quiz-card{
    background:#fafafa;
    border:1px solid #e0e0e0;
    border-radius:8px;
    padding:1.2rem;
    margin-bottom:1rem;
}
.quiz-card h3{margin-top:0;}

/* ==== Password Requirements ==== */
.password-requirements {
    margin: 0.5rem 0 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.password-requirements p {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.password-requirements ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.password-requirements li {
    padding: 0.2rem 0;
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.5rem;
}

.password-requirements li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-weight: bold;
}

.password-requirements li.valid::before {
    content: "✓";
    color: #27ae60;
}

.password-requirements li.valid {
    color: #27ae60;
}

.password-requirements li.invalid {
    color: #e74c3c;
}

/* ==== Profile Page Styles ==== */
.profile-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.profile-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--accent);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.status-card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.status-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: var(--text);
}

.status-value {
    font-weight: 500;
}

.status-paid {
    color: #28a745;
    font-weight: 600;
}

.status-unpaid {
    color: #dc3545;
    font-weight: 600;
}

.profile-form {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.cgu-acceptance {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.cgu-acceptance input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
}

.cgu-acceptance label {
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cgu-acceptance a {
    color: var(--primary);
    text-decoration: none;
}

.cgu-acceptance a:hover {
    text-decoration: underline;
}

.legal-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.legal-info p {
    margin-bottom: 1rem;
}

.legal-info p:last-child {
    margin-bottom: 0;
}

.info-text {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 1rem;
}

.form-group input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.subscription-notice {
    text-align: center;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.subscription-notice h2 {
    color: #856404;
    margin-bottom: 1rem;
}

.subscription-notice p {
    color: #856404;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.btn-subscribe {
    background: #28a745;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-subscribe:hover {
    background: #218838;
}

.training-options.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.training-card.disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.training-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.header div {
    display: flex;
    gap: 1rem;
}


/* ==== Training Menu (Burger Menu) ==== */
.training-menu {
    text-align: center;
    margin-bottom: 2rem;
}

.training-menu h2 {
    margin-bottom: 2rem;
    color: var(--accent);
    font-size: 1.8rem;
}

.training-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.training-card {
    color: white;
    border: 3px solid transparent;
    border-radius: 16px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.training-card:hover {
    transform: translateY(-5px);
}

.training-card:nth-child(1) {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: #27ae60;
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

.training-card:nth-child(1):hover {
    box-shadow: 0 12px 25px rgba(39, 174, 96, 0.6);
}

.training-card:nth-child(2) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #e74c3c;
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

.training-card:nth-child(2):hover {
    box-shadow: 0 12px 25px rgba(231, 76, 60, 0.6);
}

.training-card:nth-child(3) {
    background: linear-gradient(135deg, #2c2c2c 0%, #000000 100%);
    border-color: #333333;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.7);
}

.training-card:nth-child(3):hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.9);
}

.training-card:nth-child(4) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.training-card:nth-child(4):hover {
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.6);
}

.training-card h3 {
    margin: 0 0 1rem 0;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
}

.training-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin: 0;
}

/* ==== Configuration Panel ==== */
#configPanel {
    animation: slideInUp 0.4s ease;
}

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

.config-container {
    max-width: 600px;
    margin: 0 auto;
}

.btn-back {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-bottom: 2rem;
    padding: 0.8rem 1.5rem;
}

.btn-back:hover {
    background: var(--primary);
    color: white;
}

.selected-mode-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.mode-icon-large {
    font-size: 3rem;
}

.selected-mode-header h2 {
    margin: 0;
    color: var(--accent);
    font-size: 1.6rem;
}

.selected-mode-header p {
    margin: 0.5rem 0 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.config-section {
    margin-bottom: 2rem;
}

.config-section h3 {
    margin: 0 0 1rem 0;
    color: var(--accent);
    font-size: 1.3rem;
}

/* ==== Type Boxes (Selectable QCM Types) ==== */
.type-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.type-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.type-box:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.type-box.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.type-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.type-info {
    display: flex;
    flex-direction: column;
}

.type-title {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
}

.type-desc {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ==== Subject Dropdown ==== */
.subject-dropdown {
    position: relative;
}

.dropdown-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dropdown-btn:hover {
    border-color: var(--primary);
}

.dropdown-btn.active {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.dropdown-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.dropdown-separator {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

/* ==== Start Button ==== */
.btn-start {
    width: 100%;
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-danger.btn-start {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-danger.btn-start:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

/* ==== Custom Settings (Mode Personnalisé) ==== */
.custom-options {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.option-group {
    margin-bottom: 2rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.question-input {
    width: 100%;
    max-width: 150px;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.question-input:focus {
    outline: none;
    border-color: var(--primary);
}

.timer-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    background: #f8f9fa;
}

.radio-label:hover {
    border-color: var(--primary);
    background: #f0f8ff;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.radio-label.active {
    border-color: var(--primary);
    background: #e3f2fd;
}

.time-input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    margin: 0 0.5rem;
}

.time-input:disabled {
    background: #f5f5f5;
    color: #999;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header div {
        justify-content: center;
    }
}

/* ==== Password Reset Styles ==== */
.forgot-password-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.form-description {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    margin-bottom: 1.5rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}

.user-info {
    margin-bottom: 1rem;
}

.password-requirements {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.message p {
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* ==== Footer ==== */
.footer{margin-top:2rem;font-size:.85rem;color:var(--muted);text-align:center;}