/**
 * Aratice Quote Builder - Section Aide
 * Styles pour le conteneur d'aide sous le récapitulatif
 */

/* === Conteneur principal === */
.aqb-help {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 16px;
}

/* === Header === */
.aqb-help-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.aqb-help-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5e94e63e;
    border-radius: 40px;
}

.aqb-help-header svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.aqb-help-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

/* === Contenu === */
.aqb-help-content {
    text-align: center;
    margin-bottom: 12px;
}

.aqb-help-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

/* === Contact === */
.aqb-phone-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: transparent;
    color: #2B4B7C;
    font-weight: 600;
    width: 100%;
    border: 1px solid #2B4B7C;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    cursor: default;
}

.aqb-phone-display svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.aqb-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: #2B4B7C;
    color: white;
    font-weight: 600;
    width: 100%;
    border: 1px solid #2B4B7C;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.aqb-contact-btn:hover {
    background-color: #1e3557;
    border-color: #1e3557;
}

.aqb-contact-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* === Modal de demande de contact === */

/* Bloquer le scroll du body quand le modal est ouvert */
body.aqb-modal-open,
body.popup-open {
    overflow: hidden !important;
}

.aqb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.aqb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.aqb-modal-content {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 60vw;
    max-width: 600px;
    height: auto;
    max-height: 75vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.aqb-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #6c757d;
    padding: 0;
}

.aqb-modal-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.aqb-modal-close svg {
    width: 20px;
    height: 20px;
}

.aqb-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
}

.aqb-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px 0;
}

.aqb-modal-header p {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* Formulaire */
.aqb-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    flex: 1;
}

.aqb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.aqb-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aqb-modal-form label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.aqb-label-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    width: 100%;
    margin-left: 4px;
}

.aqb-label-wrapper svg {
    position: relative;
    bottom: 4px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    flex-shrink: 0;
}

.aqb-form-label-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.aqb-form-label-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.aqb-form-group input[type="text"],
.aqb-form-group input[type="email"],
.aqb-form-group input[type="tel"],
.aqb-form-group input[type="datetime-local"],
.aqb-form-group select,
.aqb-form-group textarea {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #2d3748;
    transition: all 0.2s;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.aqb-form-group input[type="tel"] {
    padding: 6px 16px;
}

.aqb-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%232d3748' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.aqb-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.aqb-form-group input::placeholder,
.aqb-form-group textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.aqb-form-group input:focus,
.aqb-form-group select:focus,
.aqb-form-group textarea:focus {
    border-color: #2B4B7C !important;
}

.aqb-form-group input:required:invalid {
    border-color: #e2e8f0;
}

.aqb-form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

/* Radio buttons personnalisés */
.aqb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aqb-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #4a5568;
}

.aqb-radio-label:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.aqb-radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.aqb-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.aqb-radio-label input[type="radio"]:checked~.aqb-radio-custom {
    border-color: #2B4B7C;
    background: #2B4B7C;
}

.aqb-radio-label input[type="radio"]:checked~.aqb-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.aqb-radio-label svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Actions du modal */
.aqb-modal-actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.aqb-btn-cancel,
.aqb-btn-submit {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.aqb-btn-cancel {
    background: #fff;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.aqb-btn-cancel:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.aqb-btn-submit {
    background: #2B4B7C;
    color: #fff;
    border: none;
}

.aqb-btn-submit:hover {
    background: #1e3557;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 75, 124, 0.3);
}

.aqb-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.aqb-btn-submit svg {
    width: 20px;
    height: 20px;
}

/* Champs conditionnels (téléphone et datetime) */
.aqb-phone-field,
.aqb-datetime-field {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.aqb-phone-field.show,
.aqb-datetime-field.show {
    max-height: 200px;
    opacity: 1;
}

/* Hint pour le datetime picker */
.aqb-datetime-hint {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #718096;
    font-style: italic;
}

/* Styles pour l'input datetime-local natif */
#aqb-contact-datetime {
    cursor: pointer;
    background: #fff;
}

#aqb-contact-datetime::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* === Responsive === */

/* Petits écrans mobiles */
@media (max-width: 480px) {
    .aqb-modal-content {
        width: 95%;
        max-width: 95%;
        padding: 0;
        max-height: 85vh;
        border-radius: 12px;
    }

    .aqb-modal-header {
        padding: 16px;
    }

    .aqb-modal-form {
        padding: 16px;
    }

    .aqb-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .aqb-modal-header h2 {
        font-size: 18px;
    }

    .aqb-form-group input[type="text"],
    .aqb-form-group input[type="email"],
    .aqb-form-group input[type="tel"],
    .aqb-form-group input[type="datetime-local"],
    .aqb-form-group select,
    .aqb-form-group textarea {
        padding: 10px 14px;
        font-size: 14px;
    }

    .aqb-form-row {
        grid-template-columns: 1fr;
    }

    .aqb-modal-actions {
        flex-direction: column;
    }
}

/* Tablettes et smartphones en mode portrait */
@media (max-width: 768px) {
    .aqb-help {
        padding: 20px;
    }

    .aqb-help-header h3 {
        font-size: 16px;
    }

    .aqb-help-content p {
        font-size: 13px;
    }

    .aqb-phone-display {
        padding: 10px 14px;
    }

    .aqb-help-phone,
    .aqb-help-email {
        font-size: 13px;
        padding: 10px;
    }

    .aqb-modal-content {
        width: 90%;
        padding: 0;
        max-height: 90vh;
    }

    .aqb-modal-header {
        padding: 20px;
    }

    .aqb-modal-form {
        padding: 20px;
    }

    .aqb-form-row {
        grid-template-columns: 1fr;
    }

    .aqb-modal-header h2 {
        font-size: 20px;
    }

    .aqb-modal-actions {
        flex-direction: column;
    }
}

/* Écrans moyens (tablettes en paysage) */
@media (min-width: 769px) and (max-height: 700px) {
    .aqb-modal-content {
        max-height: 85vh;
    }
}

/* Grands écrans avec petite hauteur */
@media (min-width: 1024px) and (max-height: 800px) {
    .aqb-modal-content {
        max-height: 80vh;
    }
}

/* Très grands écrans */
@media (min-width: 1440px) {
    .aqb-modal-content {
        max-width: 700px;
    }
}