/* === MODAL LOGIN/CADASTRO === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 0;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* === ABAS === */
.modal-tabs {
    display: flex;
    padding: 0 25px;
    margin-top: 20px;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px 10px 0 0;
    margin-right: 5px;
}

.tab-button:last-child {
    margin-right: 0;
}

.tab-button.active {
    background: #10b981;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e5e7eb;
    color: #374151;
}

/* === CONTEÚDO DAS ABAS === */
.tab-content {
    display: none;
    padding: 25px;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* === FORMULÁRIOS === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

/* Container para input com ícone de olho */
.password-input-container {
    position: relative;
    width: 100%;
}

.password-input-container .form-input {
    padding-right: 50px; /* Espaço para o ícone */
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.password-toggle:hover {
    color: #374151;
    background: #f3f4f6;
}

.password-toggle:focus {
    outline: none;
    color: #10b981;
    background: #f0fdf4;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* === BOTÕES === */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    width: 100%;
    padding: 14px 20px;
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* === SEPARADOR === */
.form-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #6b7280;
    font-size: 0.9rem;
}

.form-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.form-separator span {
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

/* === CHECKBOXES === */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #10b981;
}

.checkbox-label {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.checkbox-label a {
    color: #10b981;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* === LINKS === */
.form-link {
    text-align: center;
    margin-top: 20px;
}

.form-link a {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
}

.form-link a:hover {
    text-decoration: underline;
}

/* === ANIMAÇÕES === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px 0;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-tabs {
        padding: 0 20px;
        margin-top: 15px;
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .form-input {
        padding: 10px 14px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 98%;
        margin: 10px;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px 15px 0;
    }
    
    .modal-tabs {
        padding: 0 15px;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* ============================================================================
   🎯 MODAL DE CONFIRMAÇÃO DE CADASTRO
   ============================================================================ */

.confirmacao-modal {
    max-width: 500px;
    width: 90%;
}

.confirmacao-message {
    text-align: center;
    margin-bottom: 2rem;
}

.confirmacao-message p {
    margin-bottom: 1rem;
    color: #6b7280;
    line-height: 1.6;
}

.confirmacao-message strong {
    color: #3b82f6;
    font-weight: 600;
}

/* Escolha de envio */
.escolha-envio {
    margin-bottom: 2rem;
    text-align: center;
}

.escolha-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #374151;
}

.escolha-opcoes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
    background: #3b82f6;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-text {
    font-size: 1rem;
}

.btn-enviar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}

.btn-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.35);
}

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

/* Container do código de confirmação */
.codigo-container {
    margin-bottom: 2rem;
}

.codigo-container label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.codigo-inputs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.codigo-input {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #374151;
    transition: all 0.2s ease;
}

.codigo-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

.codigo-input.filled {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Botões de ação */
.confirmacao-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.35);
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Links de ação */
.confirmacao-links {
    text-align: center;
    margin-bottom: 1rem;
}

.confirmacao-links a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.confirmacao-links a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Mensagens de feedback */
.message-box {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    margin-top: 1rem;
}

.message-box.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message-box.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message-box.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================================================
   🚧 TARJA DE AJUSTES FINAIS
   ============================================================================ */

.tarja-ajustes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: linear-gradient(135deg, #930089, #ff6b6b, #930089);
    color: white;
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(147, 0, 137, 0.4);
    z-index: 1001;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    max-width: 350px;
    line-height: 1.4;
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

.tarja-ajustes::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #930089, #ff6b6b, #930089);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1);
        box-shadow: 0 15px 40px rgba(147, 0, 137, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1.02);
        box-shadow: 0 20px 50px rgba(147, 0, 137, 0.6);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1);
        box-shadow: 0 15px 40px rgba(147, 0, 137, 0.4);
    }
}

/* Responsividade da tarja */
@media (max-width: 768px) {
    .tarja-ajustes {
        max-width: 300px;
        padding: 15px 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tarja-ajustes {
        max-width: 250px;
        padding: 12px 25px;
        font-size: 13px;
    }
}

/* Responsividade */
@media (max-width: 640px) {
    .codigo-inputs {
        gap: 0.5rem;
    }
    
    .codigo-input {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .confirmacao-actions {
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* === TERMOS OBRIGATÓRIOS === */
.checkbox-group.termos-obrigatorio {
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.1), rgba(101, 163, 13, 0.1));
    border: 2px solid #84cc16;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(132, 204, 22, 0.2);
}

.checkbox-group.termos-obrigatorio::before {
    content: "⚠️";
    position: absolute;
    top: -10px;
    left: 15px;
    background: #84cc16;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.termos-label {
    color: #84cc16 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-shadow: 0 0 10px rgba(132, 204, 22, 0.3);
}

.termos-texto {
    display: block;
    line-height: 1.4;
}

.termos-link {
    color: #65a30d !important;
    text-decoration: none;
    font-weight: 800;
    border-bottom: 2px solid #84cc16;
    padding-bottom: 2px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(132, 204, 22, 0.4);
}

.termos-link:hover {
    color: #4d7c0f !important;
    border-bottom-color: #65a30d;
    text-shadow: 0 0 8px rgba(132, 204, 22, 0.6);
    transform: translateY(-1px);
}

.checkbox-group.termos-obrigatorio .checkbox-input {
    accent-color: #84cc16 !important;
    transform: scale(1.3) !important;
    border: 2px solid #84cc16 !important;
}

.checkbox-group.termos-obrigatorio:hover {
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.15), rgba(101, 163, 13, 0.15));
    box-shadow: 0 6px 20px rgba(132, 204, 22, 0.3);
    transform: translateY(-2px);
}

/* Mensagem de erro para termos */
.checkbox-group.termos-obrigatorio .error-message {
    color: #dc2626 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid #dc2626;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

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

/* === BOTÃO CADASTRAR DESABILITADO === */
.btn-cadastrar-disabled {
    background: rgba(220, 38, 38, 0.3) !important;
    color: rgba(220, 38, 38, 0.7) !important;
    border: 2px solid rgba(220, 38, 38, 0.5) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
    position: relative;
}

.btn-cadastrar-disabled::before {
    content: "⚠️";
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

.btn-cadastrar-disabled:hover {
    background: rgba(220, 38, 38, 0.3) !important;
    color: rgba(220, 38, 38, 0.7) !important;
    border: 2px solid rgba(220, 38, 38, 0.5) !important;
    transform: none !important;
    box-shadow: none !important;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* === BOTÃO CADASTRAR HABILITADO === */
.btn-cadastrar-enabled {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border: 2px solid #10b981 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-cadastrar-enabled:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: #059669 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.btn-cadastrar-enabled::before {
    content: "✅";
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}