/**
 * Aparostudio Quote - Frontend Styles
 * Version: 1.1.0 - Mobile Optimized
 */

/* Import Montserrat Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Container Principal */
.aq-quote-form-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Botão de Abertura do Modal */
.aq-button-wrapper {
    text-align: center;
    padding: 20px 0;
}

.aq-open-modal-btn {
    display: inline-block;
    padding: 14px 40px;
    background: transparent !important;
    color: #ffffff !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid #FFD700 !important;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: none !important;
    line-height: 1.5;
}

.aq-open-modal-btn:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: #FFD700 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3) !important;
}

.aq-open-modal-btn:active {
    transform: none;
}

/* Formulário */
.aq-quote-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* Cabeçalho */
.aq-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.aq-form-header h2 {
    font-size: 32px;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.aq-form-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Grupos de Formulário */
.aq-form-group {
    margin-bottom: 25px;
}

/* Linha responsiva para agrupar campos em duas colunas no desktop */
.aq-form-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.aq-form-row .aq-form-group {
    flex: 1 1 0;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .aq-form-row {
        flex-direction: column;
    }
}

.aq-form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Inputs e selects em tema escuro (quando o formulário tem fundo escuro) */
.aq-quote-form input.aq-input,
.aq-quote-form select.aq-select,
.aq-quote-form textarea.aq-textarea {
    background: #2b2b2b;
    color: #ffffff;
    border: 1px solid #444;
}

.aq-quote-form label,
.aq-quote-form h2 {
    color: #ffffff;
}

.aq-required {
    color: #e74c3c;
    font-weight: bold;
    margin-right: 3px;
}

/* Inputs */
.aq-input,
.aq-select,
.aq-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.aq-input:focus,
.aq-select:focus,
.aq-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.aq-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.aq-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Mensagens de Ajuda */
.aq-help {
    display: block;
    font-size: 13px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

/* Mensagens de Erro */
.aq-error {
    display: block;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
    min-height: 18px;
}

/* Upload de Arquivo */
.aq-file-upload {
    margin-top: 8px;
}

.aq-file-input {
    display: none;
}

.aq-file-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aq-file-label:hover {
    background: #e8f4f8;
    border-color: #3498db;
}

.aq-file-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.aq-file-preview {
    margin-top: 15px;
}

.aq-file-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Botão Submit */
.aq-form-actions {
    margin-top: 35px;
    text-align: center;
}

.aq-submit-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    background-color: #FFD700 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
    width: 100%;
}

.aq-submit-btn:hover:not(:disabled) {
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5) !important;
    transform: translateY(-2px);
}

.aq-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.aq-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.aq-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.aq-spinner,
.aq-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: aq-spin 0.6s linear infinite;
}

.aq-loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-top-color: #3498db;
}

@keyframes aq-spin {
    to { transform: rotate(360deg); }
}

/* Loading do Formulário */
.aq-form-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.98);
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    text-align: center;
    z-index: 10000;
}

.aq-form-loading p {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Modal */
.aq-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aq-modal.aq-modal-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.aq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.aq-modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 1000000 !important;
    animation: aq-modal-slide-in 0.3s ease;
}

@keyframes aq-modal-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.aq-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.aq-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

.aq-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    z-index: 1000000 !important;
}

.aq-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.aq-modal-header h3 {
    font-size: 28px;
    color: #27ae60;
    margin: 0 0 10px 0;
}

.aq-modal-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Opções de Envio */
.aq-send-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.aq-send-option {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.aq-send-option:hover {
    background: #e8f4f8;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.aq-option-content h4 {
    font-size: 18px;
    color: #333;
    margin: 0 0 6px 0;
}

.aq-option-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Aviso WhatsApp */
.aq-whatsapp-notice {
    padding: 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    margin-top: 20px;
}

.aq-notice-content strong {
    display: block;
    color: #856404;
    margin-bottom: 8px;
    font-size: 16px;
}

.aq-notice-content p {
    color: #856404;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Mensagem de Sucesso */
.aq-success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 50px 60px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    z-index: 10001;
    max-width: 500px;
    width: 90%;
}

.aq-success-message h3 {
    font-size: 24px;
    color: #27ae60;
    margin: 0 0 15px 0;
}

.aq-success-message p {
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.aq-close-success {
    background: #27ae60;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aq-close-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Responsivo */
@media (max-width: 768px) {
    /* Container */
    .aq-quote-form-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    /* Botão de Abertura */
    .aq-button-wrapper {
        padding: 15px 0;
    }
    
    .aq-open-modal-btn {
        width: 100%;
        padding: 14px 30px;
        font-size: 16px;
        letter-spacing: 0.5px;
    }
    
    /* Formulário */
    .aq-quote-form {
        padding: 25px 20px;
        border-radius: 8px;
    }
    
    /* Cabeçalho */
    .aq-form-header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .aq-form-header h2 {
        font-size: 24px;
        line-height: 1.3;
    }
    
    .aq-form-header p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Campos do formulário */
    .aq-form-group {
        margin-bottom: 20px;
    }
    
    .aq-form-group label {
        font-size: 14px;
    }
    
    .aq-input,
    .aq-select,
    .aq-textarea {
        font-size: 16px; /* Previne zoom no iOS */
        padding: 14px;
    }
    
    .aq-textarea {
        min-height: 100px;
    }
    
    /* Botão Submit */
    .aq-submit-btn {
        width: 100%;
        font-size: 16px;
        padding: 16px 30px;
    }
    
    /* Modal */
    .aq-modal-container {
        padding: 25px 20px;
        max-height: 85vh;
        width: 95%;
    }
    
    .aq-modal-close {
        width: 40px;
        height: 40px;
        font-size: 28px;
        top: 10px;
        right: 10px;
    }
    
    .aq-modal-content {
        padding: 25px 20px;
        max-height: 85vh;
        overflow-y: auto;
        width: 95%;
    }
    
    .aq-modal-header h3 {
        font-size: 22px;
    }
    
    .aq-modal-header p {
        font-size: 14px;
    }
    
    /* Opções de envio */
    .aq-send-option {
        padding: 18px;
    }
    
    .aq-option-content h4 {
        font-size: 16px;
    }
    
    .aq-option-content p {
        font-size: 13px;
    }
    
    /* Aviso WhatsApp */
    .aq-whatsapp-notice {
        padding: 15px;
    }
    
    .aq-notice-content strong {
        font-size: 14px;
    }
    
    .aq-notice-content p {
        font-size: 13px;
    }
    
    /* Mensagem de sucesso */
    .aq-success-message {
        padding: 35px 25px;
        width: 95%;
    }
    
    .aq-success-message h3 {
        font-size: 20px;
    }
    
    .aq-success-message p {
        font-size: 14px;
    }
    
    /* File upload */
    .aq-file-label {
        padding: 14px 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .aq-file-preview img {
        max-width: 100%;
        max-height: 150px;
    }
}

/* Mobile pequeno (até 480px) */
@media (max-width: 480px) {
    .aq-quote-form-container {
        margin: 15px auto;
        padding: 0 10px;
    }
    
    .aq-open-modal-btn {
        padding: 14px 25px;
        font-size: 15px;
        letter-spacing: 0.5px;
    }
    
    .aq-btn-icon {
        font-size: 20px;
    }
    
    .aq-quote-form {
        padding: 20px 15px;
    }
    
    .aq-form-header h2 {
        font-size: 20px;
    }
    
    .aq-form-header p {
        font-size: 13px;
    }
    
    .aq-modal-container {
        padding: 20px 15px;
    }
    
    .aq-modal-content {
        padding: 20px 15px;
    }
    
    .aq-submit-btn {
        padding: 14px 25px;
        font-size: 15px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .aq-modal-container {
        max-height: 95vh;
    }
    
    .aq-modal-content {
        max-height: 90vh;
    }
}

/* Forçar comportamento desktop para .aq-form-row em viewports largos
   (garante duas colunas se houver espaço; corrige casos em que outras regras
   ou caching forçam layout em coluna) */
@media (min-width: 769px) {
    .aq-form-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
        align-items: flex-start !important;
    }

    .aq-form-row .aq-form-group {
        flex: 1 1 0 !important;
    }
}

/* Forçar estilos escuros para inputs dentro do formulário (colocados no fim
   para sobrepor regras anteriores que definem inputs brancos) */
.aq-quote-form .aq-input,
.aq-quote-form .aq-select,
.aq-quote-form .aq-textarea {
    background: #2b2b2b !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
}

.aq-quote-form .aq-input:focus,
.aq-quote-form .aq-select:focus,
.aq-quote-form .aq-textarea:focus {
    outline: none !important;
    border-color: #666 !important;
    box-shadow: 0 0 0 3px rgba(102,102,102,0.12) !important;
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .aq-input,
    .aq-select,
    .aq-textarea,
    .aq-submit-btn,
    .aq-open-modal-btn {
        min-height: 44px; /* Apple's recommended touch target */
    }
    
    .aq-file-label {
        min-height: 50px;
    }
    
    .aq-modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Prevenção de scroll do body quando modal está aberto */
body.aq-modal-open {
    overflow: hidden !important;
}
