/* ACPR Specific Styles - Version Densifiée */

/* Page Header - Plus compact */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.back-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: #7f8c8d;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #3498db;
}

.page-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    text-align: center;
    font-weight: 700;
}

.page-header p {
    text-align: center;
    color: #7f8c8d;
    font-size: 1rem;
    margin: 0;
}

/* Form Layout - Version ÉQUILIBRÉE */
.acpr-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group h3 {
    color: #2c3e50;
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    border-left: 4px solid #3498db;
    padding-left: 0.75rem;
    line-height: 1.3;
}

.form-group input[type="number"] {
    width: 120px;
    padding: 0.6rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}

/* File Choice Tabs - Version ULTRA compacte */
.file-choice {
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
}

.choice-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    font-size: 0.85rem;
}

.tab-btn.active {
    color: #3498db;
    background: white;
    border-bottom-color: #3498db;
}

.tab-btn:hover:not(.active) {
    color: #5d6d7e;
    background: rgba(52, 152, 219, 0.05);
}

/* Tab Content - Padding correct */
.tab-content {
    display: none;
    padding: 1rem;
    min-height: auto;
    background: white;
}

.tab-content.active {
    display: block;
}

/* Local Files - Tout sur une ligne */
.local-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-option {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-height: auto;
}

.file-option:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-option input[type="radio"] {
    margin-right: 0.75rem;
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    flex-shrink: 0;
}

.file-option input[type="radio"]:checked + .file-info {
    color: #3498db;
}

.file-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 1rem;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
    line-height: 1.2;
    flex-shrink: 0;
    text-align: right;
}

.no-files {
    text-align: center;
    padding: 1.2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Upload Zone - Taille normale */
.upload-zone {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.upload-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
    min-height: 80px;
}

.upload-label:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.02);
}

.upload-icon {
    font-size: 1.4rem;
    color: #7f8c8d;
    flex-shrink: 0;
}

.upload-text {
    flex: 1;
    min-width: 0;
}

.upload-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.upload-text span {
    color: #7f8c8d;
    font-size: 0.8rem;
    line-height: 1.2;
}

.upload-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 4px;
    color: #27ae60;
    font-weight: 600;
    display: none;
    font-size: 0.85rem;
}

.upload-info.show {
    display: block;
}

/* Section Vérification - Design équilibré */
.verification-section {
    border: 2px solid rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 1.2rem;
    background: rgba(39, 174, 96, 0.02);
    position: relative;
}

.verification-section::before {
    content: '🔍';
    position: absolute;
    top: -8px;
    right: 12px;
    background: white;
    padding: 0 6px;
    font-size: 1rem;
}

.verification-section h3 {
    color: #27ae60;
    border-left-color: #27ae60;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    padding-left: 0.75rem;
}

.verification-description {
    margin-bottom: 1rem;
}

.verification-description p {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.verification-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.verification-benefits span {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 500;
    background: rgba(39, 174, 96, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    line-height: 1.2;
}

.verification-upload {
    border-color: #27ae60 !important;
}

.verification-upload:hover {
    border-color: #2ecc71 !important;
    background: rgba(39, 174, 96, 0.05) !important;
}

/* Options Avancées - Layout horizontal compact */
.advanced-options {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #ecf0f1;
}

.advanced-options h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    border: 1px solid transparent;
}

.option-item:hover {
    background: rgba(52, 152, 219, 0.05);
    border-color: rgba(52, 152, 219, 0.1);
}

.option-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    margin-top: 1px;
}

.option-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
}

.option-text small {
    color: #7f8c8d;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Form Actions - Plus compact */
.form-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    min-width: 220px;
}

.btn-icon {
    font-size: 1.1rem;
}

.generation-info {
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.generation-info p {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.info-list span {
    font-size: 0.8rem;
    color: #5d6d7e;
    font-weight: 500;
    background: rgba(52, 152, 219, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

/* File drag states */
.upload-label.drag-over {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
}

/* Responsive - Plus compact sur mobile */
@media (max-width: 768px) {
    .acpr-form {
        padding: 1.25rem;
    }
    
    .page-header {
        padding: 1.25rem;
    }
    
    .back-link {
        position: static;
        display: block;
        margin-bottom: 0.75rem;
    }
    
    .choice-tabs {
        flex-direction: column;
    }
    
    .upload-label {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .btn-large {
        width: 100%;
        min-width: auto;
    }
    
    .verification-section {
        padding: 0.75rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .option-item {
        padding: 0.4rem;
    }
    
    .generation-info {
        padding: 0.5rem;
    }
    
    .info-list {
        flex-direction: column;
        align-items: center;
    }
    
    .verification-benefits {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Loading states */
.processing {
    opacity: 0.7;
    pointer-events: none;
}

.processing .btn-primary {
    background: #bdc3c7;
}

.processing .btn-primary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    color: #c0392b;
}

.error-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.error-text {
    font-weight: 600;
    flex: 1;
    font-size: 0.9rem;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* États focus améliorés */
.tab-btn:focus,
.file-option:focus-within,
.option-item:focus-within,
.upload-label:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Optimisations pour les petits écrans */
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .tab-content {
        padding: 0.75rem;
    }
    
    .file-option {
        padding: 0.5rem;
    }
    
    .upload-label {
        padding: 0.75rem;
    }
}