/* Estilos para o formulário de recolha */
.recolha-form-container {
    max-width: 900px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.form-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f3f5;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    display: flex;
    align-items: center;
    color: #2d3436;
    font-size: 1.25rem;
    margin: 0 0 1.5rem 0;
    font-weight: 600;
}

.form-section-title i {
    margin-right: 10px;
    color: #c1121f;
    font-size: 1.1em;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group.full-width {
    flex: 0 0 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.form-group .required-field::after {
    content: ' *';
    color: #c1121f;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-with-icon textarea + i {
    top: 1.5rem;
    transform: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #495057;
}

textarea {
    min-height: 120px;
    resize: vertical;
    padding: 15px 15px 15px 45px;
    line-height: 1.5;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #c1121f;
    box-shadow: 0 0 0 0.2rem rgba(193, 18, 31, 0.15);
    outline: none;
    background-color: #fff;
}

/* Estilo para o campo de telefone com código de país */
.phone-input-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding-left: 40px;
}

.phone-input-container {
    display: flex;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.country-code {
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    height: 38px;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 110px !important;
    padding: 0 25px 0 10px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23495057%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px auto;
    font-size: 14px;
    line-height: 38px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-input-container {
    display: flex;
    width: 100%;
}

.phone-input-container input[type="tel"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    flex: 1;
    height: 38px;
}

.phone-input-container input[type="tel"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.country-code:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.phone-input-container input[type="tel"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    flex: 1;
    height: 38px; /* Mesma altura do select */
}

/* Estilo para o botão de envio */
.form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f3f5;
    width: 100%;
}

.form-actions .btn-submit {
    align-self: flex-start;
    margin-bottom: 1rem;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background-color: #c1121f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(193, 18, 31, 0.2);
}

.btn-submit:hover {
    background-color: #a50e1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(193, 18, 31, 0.25);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(193, 18, 31, 0.2);
}

.btn-submit i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Nota de segurança */
.form-note {
    margin: 1.5rem 0 0.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #28a745;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.security-icon {
    background: #28a745;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
}

.security-content {
    flex: 1;
}

.security-content h4 {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.security-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.security-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.security-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.security-feature i {
    color: #28a745;
    font-size: 0.9em;
}

/* Responsividade */
@media (max-width: 768px) {
    .security-features {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .security-feature {
        width: 100%;
        box-sizing: border-box;
    }
    
    .linha-formulario {
        flex-direction: column;
        gap: 0;
    }
    
    .grupo-formulario {
        width: 100%;
    }
    
    .form-section {
        padding: 1.25rem 1.5rem;
    }
    
    .info-box {
        margin: 1.5rem 1.5rem;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 15px;
    }
    
    .info-box strong {
        color: #2c3e50;
    }
    
    .info-box ul {
        margin: 10px 0;
        padding-left: 20px;
    }
    
    .info-box li {
        margin: 5px 0;
        list-style-type: none;
    }
    
    .info-box li i {
        color: #2ecc71; /* Verde mais bonito e moderno */
        margin-right: 8px;
        font-size: 1.1em; /* Tamanho um pouco maior */
    }
    
    /* Corrigir overflow do container do telefone */
    .phone-input-container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding-left: 0;
    }
    
    .country-code {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        padding: 0 15px 0 5px !important;
        font-size: 12px;
    }
    
    /* Garantir que inputs não saiam do container */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    /* Ajustar ainda mais o código do país em ecrãs muito pequenos */
    .country-code {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        padding: 0 10px 0 3px !important;
        font-size: 11px;
    }
    
    /* Garantir que não há scroll horizontal */
    .recolha-form-container {
        overflow-x: hidden;
    }
    
    .form-section {
        overflow-x: hidden;
    }
}

/* Notificações */
.form-notification {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.form-notification.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.form-notification.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Mensagens de erro */
.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Estilo para campos com erro */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #dc3545;
    background-color: #fff8f8;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-group.has-error .input-with-icon i {
    color: #dc3545;
}

/* Mostrar mensagem de erro quando o campo tem a classe tocado */
.form-group.has-error .error-message {
    display: block;
    animation: aparecer 0.3s ease-out;
}

/* Animar a mensagem de erro */
@keyframes tremer {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.has-error {
    animation: tremer 0.5s ease-in-out;
}

/* Animações */
@keyframes aparecer {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.secao-formulario {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.secao-formulario:nth-child(1) { animation-delay: 0.1s; }
.secao-formulario:nth-child(2) { animation-delay: 0.2s; }
.secao-formulario:nth-child(3) { animation-delay: 0.3s; }

/* Estado de sucesso para campos validados */
.form-group.has-success input,
.form-group.has-success select,
.form-group.has-success textarea {
    border-color: #28a745;
    background-color: #f8fff8;
}
.form-group.has-success .input-with-icon i {
    color: #28a745;
}

/* Botão durante submissão */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.85;
}
.btn-submit.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Ajuste para input[type="file"] */
input[type="file"] {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

/* Estilo para o campo de quantidade */
.quantity-selector {
    display: flex;
    align-items: center;
    max-width: 150px;
}

.quantity-selector button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-selector button:hover {
    background: #e0e0e0;
}

.quantity-selector input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    height: 36px;
    padding: 0;
    background: #fff;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield; /* Padrão */
}

/* Remove as setas em navegadores WebKit */
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Estilo para o checkbox da política de privacidade */
.recolha-form .privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.recolha-form .privacy-notice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

.recolha-form .privacy-notice label {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

.recolha-form .privacy-notice label span {
    display: inline;
}

.recolha-form .privacy-notice label a {
    display: inline;
    color: #c1121f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.recolha-form .privacy-notice label a:hover {
    text-decoration: underline;
    color: #8B0000;
}
