* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

/* ========================================
   LANDING PAGE STYLES
======================================== */

.landing-page {
    padding: 0;
}

.hero-section {
    padding: 30px 25px;
    text-align: center;
}

.emoji-header {
    font-size: 3em;
    margin-bottom: 20px;
}

.main-title {
    margin-bottom: 25px;
    line-height: 1.3;
}

.main-title .highlight {
    color: #4f46e5;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.main-title .job-title {
    color: #1a1a1a;
    font-size: 1.4em;
    font-weight: 800;
    display: block;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.intro-text {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    border-left: 4px solid #667eea;
}

.intro-text p {
    margin-bottom: 12px;
    font-size: 0.95em;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.benefits-section,
.requirements-section {
    margin: 30px 0;
    text-align: left;
}

.benefits-section h2,
.requirements-section h2 {
    color: #1a1a1a;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.benefits-list,
.requirements-list {
    list-style: none;
    padding: 0;
}

.benefits-list li,
.requirements-list li {
    background: #f8f9fa;
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 10px;
    border-left: 3px solid #28a745;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.requirements-list li {
    border-left-color: #667eea;
}

.benefits-list li:hover,
.requirements-list li:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.cta-section {
    margin: 40px 0 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    color: white;
    text-align: center;
}

.cta-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-primary {
    background: white;
    color: #667eea;
    border: none;
    padding: 18px 35px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    min-width: 250px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    background: #f8f9fa;
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* ========================================
   CADASTRO SECTION STYLES
======================================== */

.cadastro-section {
    animation: slideInRight 0.5s ease-out;
}

.form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.form-header h1 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.form-cadastro {
    padding: 0;
}

.section {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.section:last-of-type {
    border-bottom: none;
}

.section h2 {
    color: #4A5568;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #E2E8F0;
}

.section h2::before {
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    content: "";
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2D3748;
    font-size: 0.9em;
    letter-spacing: 0.3px;
}

.form-group label::after {
    content: " *";
    color: #E53E3E;
    display: none;
}

label[for="cpf"]::after,
label[for="nome"]::after,
label[for="data_nascimento"]::after,
label[for="estado_civil"]::after,
label[for="apelido"]::after,
label[for="nome_mae"]::after,
label[for="rg"]::after,
label[for="orgao_expedidor"]::after,
label[for="uf_expedidor"]::after,
label[for="data_expedicao"]::after,
label[for="endereco"]::after,
label[for="bairro"]::after,
label[for="cidade"]::after,
label[for="uf"]::after,
label[for="cep"]::after,
label[for="celular"]::after,
label[for="email"]::after,
label[for="banco"]::after,
label[for="agencia"]::after,
label[for="conta"]::after,
label[for="titular"]::after,
label[for="cpf_titular"]::after,
label[for="tipo_pix"]::after,
label[for="chave_pix"]::after {
    display: inline;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFAFA;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #48BB78;
    background: #F0FFF4;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #E53E3E;
    background: #FED7D7;
}

/* ========================================
   DROPDOWN ARROW - SINGLE ARROW FIX
   ===================================== */

/* Base select styling with SINGLE arrow */
.form-group select {
    cursor: pointer;
    /* SINGLE consistent arrow - no state changes to avoid conflicts */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m7 10 5 5 5-5'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    padding-right: 50px;
    
    /* Complete removal of native arrows */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    background-color: #FAFAFA;
    min-height: 52px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Aggressive removal of native dropdown buttons */
.form-group select::-ms-expand {
    display: none !important;
}

.form-group select::-webkit-dropdown-button {
    display: none !important;
}

/* FIXED: No background-image changes on focus/active to prevent multiple arrows */
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    /* Keep same arrow - no change */
}

.form-group select:active {
    transform: scale(0.995);
    /* Keep same arrow - no change */
}

/* Mobile-specific select improvements - SIMPLIFIED TO AVOID CONFLICTS */
@media (max-width: 768px) {
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 56px;
        /* Keep consistent arrow positioning - no overrides */
        border-width: 2px;
        border-radius: 14px;
    }
    
    .form-group select:focus {
        border-width: 3px;
        /* Remove transform that might cause visual conflicts */
    }
    
    .form-group select:active {
        /* Simplified active state */
        transition: transform 0.1s ease;
    }
}

/* Extra mobile improvements for very small screens - SIMPLIFIED */
@media (max-width: 480px) {
    .form-group select {
        min-height: 50px;
        font-size: 16px;
        padding: 15px 50px 15px 16px;
        /* Keep consistent arrow - no size/position overrides */
        border-radius: 12px;
    }
}

/* Enhanced touch feedback - SIMPLIFIED */
@media (hover: none) and (pointer: coarse) {
    .form-group select {
        min-height: 54px;
        padding: 16px 54px 16px 18px;
        font-size: 16px;
        border-radius: 14px;
        /* Keep consistent arrow - no size/position overrides */
    }
    
    .form-group select:focus {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
        border-color: #667eea;
    }
    
    .form-group select:active {
        background-color: #f0f4ff;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    }
}

.error {
    border-color: #E53E3E !important;
    background-color: #FED7D7 !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.error-message {
    color: #E53E3E;
    font-size: 0.8em;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.error-message::before {
    content: "⚠️";
    font-size: 0.9em;
}

.success-message {
    background: linear-gradient(135deg, #48BB78, #38A169);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message::before {
    content: "✅";
    font-size: 1.2em;
}

.form-actions {
    padding: 25px 20px;
    background: #F7FAFC;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    bottom: 0;
    border-top: 1px solid #E2E8F0;
}

.btn-submit,
.btn-reset {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    order: 1;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

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

.btn-reset {
    background: white;
    color: #718096;
    border: 2px solid #E2E8F0;
    order: 2;
}

.btn-reset:hover {
    background: #F7FAFC;
    border-color: #CBD5E0;
    color: #4A5568;
}

/* Loading state */
.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-submit.loading {
    color: transparent;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MODAL STYLES
======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    margin-bottom: 20px;
    color: #4a5568;
    font-weight: 500;
}

.missing-fields-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

.missing-fields-list li {
    background: #fed7d7;
    color: #c53030;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 10px;
    border-left: 4px solid #e53e3e;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.missing-fields-list li::before {
    content: "❌";
    font-size: 0.9em;
}

.modal-footer {
    padding: 20px 25px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.btn-continue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    min-width: 150px;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-continue:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* Touch improvements */
@media (hover: none) {
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Improved select placeholder styling - SAFE APPROACH */
.form-group select:invalid {
    color: #a0aec0;
}

.form-group select:valid {
    color: #2d3748;
}

/* Remove option styling that causes dropdown conflicts */
/* NOTE: option tags cannot be reliably styled across browsers/mobile */

/* Mobile-specific dropdown improvements - SIMPLIFIED */
@media (max-width: 768px) {
    /* Focus handling that doesn't interfere with native dropdown */
    .form-group select:focus {
        position: relative;
        z-index: 1; /* Reduced from 10 to avoid conflicts */
    }
    
    /* Ensure dropdown appears above other elements when needed */
    .form-group select:focus-visible {
        z-index: 2;
    }
}

/* Improved focus states for accessibility */
.form-group input:focus-visible,
.form-group select:focus-visible,
.btn-submit:focus-visible,
.btn-reset:focus-visible,
.btn-primary:focus-visible,
.btn-back:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .intro-text {
        background: linear-gradient(135deg, #4a5568, #2d3748);
        color: #e2e8f0;
    }
    
    .benefits-list li,
    .requirements-list li {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .section {
        border-bottom-color: #4a5568;
    }
    
    .section h2 {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .form-group label {
        color: #e2e8f0;
    }
    
    .form-group input,
    .form-group select {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .form-group input::placeholder {
        color: #a0aec0;
    }
    
    .form-actions {
        background: #1a202c;
        border-top-color: #4a5568;
    }
    
    .btn-reset {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
}

/* Large screens - make it centered and constrained */
@media (min-width: 768px) {
    body {
        padding: 40px 20px;
    }
    
    .container {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .form-header h1 {
        font-size: 1.6em;
    }
    
    .main-title .job-title {
        font-size: 1.6em;
    }
    
    .form-actions {
        position: static;
        flex-direction: row;
        justify-content: center;
        padding: 30px;
    }
    
    .btn-submit,
    .btn-reset {
        width: auto;
        min-width: 160px;
    }
    
    .btn-primary {
        min-width: 280px;
        padding: 20px 40px;
    }
}

/* Mobile improvements */
@media (max-width: 480px) {
    .main-title .highlight {
        color: #3730a3;
        font-weight: 800;
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    .main-title .job-title {
        color: #000000;
        font-weight: 900;
        text-shadow: 0 2px 4px rgba(0,0,0,0.15);
        font-size: 1.3em;
    }
    
    .benefits-section h2,
    .requirements-section h2 {
        color: #000000;
        font-weight: 800;
        font-size: 1.15em;
        text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .hero-section {
        padding: 20px 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 14px 16px;
    }
    
    .main-title .highlight {
        color: #312e81;
        font-weight: 900;
        font-size: 1em;
    }
    
    .main-title .job-title {
        font-size: 1.1em;
        color: #000000;
        font-weight: 900;
    }
    
    .benefits-section h2,
    .requirements-section h2 {
        font-size: 1.1em;
        color: #000000;
        font-weight: 800;
    }
    
    .btn-primary {
        min-width: auto;
        width: 100%;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   CEP CONSULTATION STYLES
======================================== */

/* Loading state for CEP field */
.form-group input.loading {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3e%3ccircle fill='none' stroke='%234f46e5' stroke-width='10' stroke-miterlimit='10' stroke-dasharray='164.93361431346415 56.97787143782138' cx='50' cy='50' r='35'%3e%3canimateTransform attributeName='transform' type='rotate' repeatCount='indefinite' dur='1s' values='0 50 50;360 50 50' keyTimes='0;1'%3e%3c/animateTransform%3e%3c/circle%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    padding-right: 40px;
}

/* CEP messages */
.cep-message {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.cep-message.success {
    background-color: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.cep-message.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.cep-message.info {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* Animation for CEP messages */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CEP field focus state with better visual feedback */
#cep:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Responsive adjustments for CEP messages */
@media (max-width: 480px) {
    .cep-message {
        padding: 10px 12px;
        font-size: 13px;
        margin: 8px 0;
    }
}

/* ========================================
   SUCCESS CARD ANIMATIONS
======================================== */

/* Fade in/out animations for overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide up animation for success card */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Success card responsive adjustments */
@media (max-width: 480px) {
    .success-card {
        padding: 30px 20px !important;
        margin: 20px !important;
    }
    
    .success-card h2 {
        font-size: 1.3em !important;
    }
    
    .success-card p {
        font-size: 0.9em !important;
    }
}

/* Success card accessibility improvements */
.success-card-overlay {
    backdrop-filter: blur(2px);
}

.success-card button:focus {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

/* ========================================
   MOBILE SELECT/FLAGS ENHANCEMENTS - CONFLICT-FREE
======================================== */

/* REMOVED CONFLICTING RULES TO PREVENT MULTIPLE ARROWS */
/* All arrow styling is now handled in the main section above */

/* iOS specific improvements - MINIMAL TO AVOID CONFLICTS */
@supports (-webkit-appearance: none) {
    .form-group select {
        -webkit-appearance: none !important;
        -webkit-border-radius: 12px;
    }
    
    @media (max-width: 768px) {
        .form-group select {
            font-size: 16px; /* Prevents zoom */
            -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
        }
    }
}

/* Android specific improvements - NO ARROW OVERRIDES */
@media (max-width: 768px) and (pointer: coarse) {
    .form-group select {
        /* REMOVED: background-size, background-position overrides */
        touch-action: manipulation;
    }
}

/* High contrast mode support - NO ARROW OVERRIDE */
@media (prefers-contrast: high) {
    .form-group select {
        border-width: 3px;
        /* REMOVED: background-image override to prevent duplicate arrows */
    }
    
    .form-group select:focus {
        border-color: #000000;
        /* REMOVED: background-image override to prevent duplicate arrows */
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .form-group select {
        transition: none;
    }
    
    .form-group select:active {
        transform: none;
    }
    
    .select-wrapper::after {
        transition: none;
    }
}

/* ========================================
   DROPDOWN FIX - CROSS-BROWSER COMPATIBLE
======================================== */

/* SPECIFIC FIX for Estado Civil field - Single Arrow Guarantee */
#estado_civil,
#tipo_pix {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m7 10 5 5 5-5'/%3e%3c/svg%3e") !important;
    background-position: right 16px center !important;
    background-repeat: no-repeat !important;
    background-size: 20px 20px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

#estado_civil:focus,
#tipo_pix:focus,
#estado_civil:active,
#tipo_pix:active {
    /* Keep same single arrow on focus/active - NO CHANGES */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m7 10 5 5 5-5'/%3e%3c/svg%3e") !important;
}

/* Reset any problematic styles that interfere with native dropdowns */
.form-group select {
    /* Ensure native dropdown behavior is preserved */
    position: relative;
    z-index: auto;
}

/* Fix for dropdown overlay issues */
.form-group select:focus {
    /* Remove any styles that might interfere with native dropdown positioning */
    position: relative;
    z-index: 1;
}

/* Prevent background styles from interfering with dropdown options */
.form-group select:focus,
.form-group select:active {
    /* Keep background simple when dropdown is open */
    background-color: white;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    .form-group select {
        /* Ensure proper touch behavior */
        -webkit-appearance: none;
        appearance: none;
        
        /* Reset any conflicting positioning */
        position: relative;
        z-index: auto;
    }
    
    .form-group select:focus {
        /* Minimal styling to avoid conflicts */
        outline: none;
        border-color: #667eea;
        z-index: 1;
    }
    
    /* Ensure form doesn't interfere with dropdown */
    .form-cadastro {
        /* Allow dropdowns to appear above form elements */
        position: relative;
        z-index: auto;
    }
    
    .section {
        /* Prevent section styling from interfering */
        position: relative;
        z-index: auto;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-appearance: none) {
    @media (max-width: 768px) {
        .form-group select {
            /* Ensure iOS doesn't add its own styling conflicts */
            -webkit-appearance: none;
            -webkit-border-radius: 12px;
        }
    }
}