/**
 * Pare-Brise Devis Pro - Styles Premium
 * Design moderne avec charte vert clair (#6CC97F)
 */

:root {
    --primary-color: #6CC97F;
    --primary-color-dark: #5AB86D;
    --primary-color-light: #8DD99F;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #E0E0E0;
    --gray-dark: #666666;
    --text-color: #333333;
    --border-radius: 10px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Container principal */
.parebrise-devis-pro-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Barre de progression */
.parebrise-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.parebrise-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    opacity: 0.4;
    transition: var(--transition);
}

.parebrise-progress-step.active {
    opacity: 1;
}

.parebrise-progress-step.completed {
    opacity: 1;
}

.parebrise-progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-medium);
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: var(--transition);
}

.parebrise-progress-step.active .step-number {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(108, 201, 127, 0.2);
}

.parebrise-progress-step.completed .step-number {
    background: var(--primary-color-dark);
    color: var(--white);
}

.parebrise-progress-step .step-label {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--gray-dark);
}

.parebrise-progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.parebrise-progress-line {
    flex: 1;
    height: 2px;
    background: var(--gray-medium);
    margin: 0 10px;
    position: relative;
    top: -20px;
}

.parebrise-progress-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--primary-color);
    transition: width 0.5s ease;
}

.parebrise-progress-step.completed ~ .parebrise-progress-line::after {
    width: 100%;
}

/* Formulaire */
.parebrise-devis-form {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.parebrise-form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.parebrise-form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.parebrise-step-header {
    text-align: center;
    margin-bottom: 30px;
}

.parebrise-step-header h2 {
    color: var(--text-color);
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.parebrise-step-header p {
    color: var(--gray-dark);
    font-size: 16px;
    margin: 0;
}

/* Grille de formulaire */
.parebrise-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .parebrise-form-grid {
        grid-template-columns: 1fr;
    }
}

.parebrise-form-group {
    margin-bottom: 20px;
}

.parebrise-form-group-full {
    grid-column: 1 / -1;
}

.parebrise-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.parebrise-form-group input[type="text"],
.parebrise-form-group input[type="email"],
.parebrise-form-group input[type="tel"],
.parebrise-form-group select,
.parebrise-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-color);
    box-sizing: border-box;
}

.parebrise-form-group input:focus,
.parebrise-form-group select:focus,
.parebrise-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 201, 127, 0.1);
}

/* Champs personnalisés (marque et modèle) */
.parebrise-custom-model,
.parebrise-custom-make {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-color);
    box-sizing: border-box;
    margin-top: 10px;
}

.parebrise-custom-model:focus,
.parebrise-custom-make:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 201, 127, 0.1);
}

.parebrise-custom-model.error,
.parebrise-custom-make.error {
    border-color: #ff4444;
}

.parebrise-custom-model.error:focus,
.parebrise-custom-make.error:focus {
    border-color: #ff4444;
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.parebrise-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Zone d'upload */
.parebrise-upload-area {
    border: 2px dashed var(--gray-medium);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    background: var(--gray-light);
    transition: var(--transition);
    cursor: pointer;
}

.parebrise-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.05);
}

.parebrise-upload-placeholder {
    color: var(--gray-dark);
}

.parebrise-upload-placeholder svg {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.parebrise-upload-placeholder p {
    margin: 10px 0 5px 0;
    font-weight: 500;
}

.parebrise-upload-placeholder small {
    color: var(--gray-dark);
    font-size: 12px;
}

.parebrise-upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.parebrise-upload-preview-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: var(--shadow);
}

.parebrise-upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.parebrise-upload-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4444;
    font-size: 16px;
    transition: var(--transition);
}

.parebrise-upload-preview-item .remove-image:hover {
    background: #ff4444;
    color: var(--white);
    transform: scale(1.1);
}

/* Checkbox personnalisée */
.parebrise-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.parebrise-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Boutons */
.parebrise-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-medium);
}

.parebrise-btn {
    padding: 14px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parebrise-btn-next,
.parebrise-btn-submit {
    background: var(--primary-color);
    color: var(--white);
    flex: 1;
    max-width: 200px;
    margin-left: auto;
}

.parebrise-btn-next:hover,
.parebrise-btn-submit:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.parebrise-btn-back {
    background: var(--gray-light);
    color: var(--text-color);
    border: 2px solid var(--gray-medium);
}

.parebrise-btn-back:hover {
    background: var(--gray-medium);
    border-color: var(--gray-dark);
}

.parebrise-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Récapitulatif */
.parebrise-recap {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
}

.parebrise-recap-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-medium);
}

.parebrise-recap-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.parebrise-recap-section h4 {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.parebrise-recap-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
}

.parebrise-recap-item-label {
    font-weight: 500;
    color: var(--gray-dark);
}

.parebrise-recap-item-value {
    color: var(--text-color);
    text-align: right;
}

.parebrise-recap-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.parebrise-recap-photos img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Messages */
.parebrise-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.parebrise-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.parebrise-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading spinner */
.parebrise-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .parebrise-devis-pro-wrapper {
        padding: 20px 15px;
    }
    
    .parebrise-devis-form {
        padding: 25px 20px;
    }
    
    .parebrise-progress-bar {
        padding: 15px 10px;
    }
    
    .parebrise-progress-step .step-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .parebrise-progress-step .step-label {
        font-size: 10px;
    }
    
    .parebrise-step-header h2 {
        font-size: 24px;
    }
    
    .parebrise-form-actions {
        flex-direction: column;
    }
    
    .parebrise-btn-next,
    .parebrise-btn-submit {
        max-width: 100%;
        width: 100%;
    }
}

/* Styles pour l'administration */
.parebrise-devis-admin {
    background: var(--white);
    padding: 20px;
}

.parebrise-devis-admin h3 {
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.parebrise-devis-admin h3:first-child {
    margin-top: 0;
}

.parebrise-devis-admin .form-table th {
    width: 150px;
    font-weight: 600;
}

/* Améliorations visuelles */
.parebrise-devis-pro-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-light));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* ============================================
   STYLES RR PARE-BRISE
   ============================================ */

/* Style Rapid */
.parebrise-devis-pro-wrapper.rapid-style .parebrise-progress-step .step-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.parebrise-devis-pro-wrapper.rapid-style .parebrise-progress-step .step-number {
    display: none;
}

/* Options de cartes avec images */
.parebrise-vitrage-options,
.parebrise-dommage-grid,
.parebrise-intervention-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.parebrise-option-card {
    position: relative;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    overflow: hidden;
}

.parebrise-option-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.parebrise-option-card.selected {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.05);
    box-shadow: 0 0 0 3px rgba(108, 201, 127, 0.2);
}

.parebrise-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.parebrise-option-card .option-image {
    margin-bottom: 15px;
}

.parebrise-option-card .option-image img {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
}

.parebrise-option-card .option-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.parebrise-option-card .option-label {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
}

/* Sous-options */
.parebrise-sub-options {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-medium);
}

.parebrise-sub-options h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 18px;
}

.parebrise-sub-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.parebrise-sub-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.parebrise-sub-option:hover {
    border-color: var(--primary-color);
}

.parebrise-sub-option input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--primary-color);
}

.parebrise-sub-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.parebrise-sub-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.05);
}

/* Options de dommage */
.parebrise-dommage-options {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-medium);
}

.parebrise-dommage-options h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 18px;
}

/* Identification véhicule */
.parebrise-identification-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.parebrise-radio-option {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    flex: 1;
}

.parebrise-radio-option:hover {
    border-color: var(--primary-color);
}

.parebrise-radio-option input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--primary-color);
}

.parebrise-radio-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.05);
}

.identification-field {
    margin-top: 15px;
}

/* Options d'intervention */
.parebrise-intervention-options {
    margin: 20px 0;
}

/* Upload de documents */
.parebrise-documents-upload {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.parebrise-document-item {
    display: flex;
    flex-direction: column;
}

.parebrise-document-item label {
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
}

.parebrise-upload-area-small {
    position: relative;
}

.parebrise-upload-placeholder-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px dashed var(--gray-medium);
    border-radius: var(--border-radius);
    background: var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.parebrise-upload-placeholder-small:hover {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.05);
}

.parebrise-upload-placeholder-small.has-file {
    border-color: var(--primary-color);
    background: rgba(108, 201, 127, 0.1);
}

.parebrise-upload-placeholder-small span:first-child {
    font-size: 20px;
}

/* Labels optionnels */
.optional {
    color: var(--gray-dark);
    font-weight: normal;
    font-size: 0.9em;
}

/* Responsive pour Rapid style */
@media (max-width: 768px) {
    .parebrise-vitrage-options,
    .parebrise-dommage-grid,
    .parebrise-intervention-options {
        grid-template-columns: 1fr;
    }
    
    .parebrise-sub-options-grid {
        grid-template-columns: 1fr;
    }
    
    .parebrise-identification-options {
        flex-direction: column;
    }
    
}

    
    .parebrise-documents-upload {
        grid-template-columns: 1fr;
    }
}

