/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Remove o botão nativo de mostrar senha (Edge, IE) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* Remove o botão nativo de mostrar senha (Chrome, Safari, etc.) */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container,
input[type="password"]::-webkit-clear-button {
    display: none !important;
    -webkit-appearance: none;
}

/* Grupos de formulário */
.form-group {
    margin-bottom: 10px;
    text-align: left;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Container principal */
.cadastro-container {
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    padding: 0;
    margin: 0;
}

.row.no-gutters {
    margin: 0;
    height: 100vh;
    align-items: stretch;
    flex: 1;
}

.row.no-gutters > .col,
.row.no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
}

/* Seção de fundo - Exatamente como era antes */
.login-background {
    height: 100vh;
    background: white;
}

.login-background img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Seção do formulário */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 450px;
}

/* Formulário */
.form-wrapper {
    width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 0; 
    box-shadow: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 500px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cadastro-form {
    width: 100%;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 20px;
}

.logo {
    max-width: 245px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Alertas */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #324673;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert i {
    font-size: 1.1rem;
}

/* Formulário */
.login-form {
    width: 100%;
}

/* Header do formulário */
.form-header {
    text-align: center;
    padding: 0 16px;
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    margin-bottom: 8px;
    margin-top: 50px;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    margin-top: 10px;
}

.form-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.form-label i {
    color: #6b7280;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.form-label .fab.fa-whatsapp {
    color: #324673;
    font-size: 1.1em;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}


.form-control {
    width: 100%;
    padding: 10px 10px;
    padding-right: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.form-control:focus {
    border-color: #324673;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(50, 70, 115, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Ícones e botões dos inputs */
.input-icon {
    position: absolute;
    left: 1rem;
    color: #475569;
    font-size: 0.875rem;
    z-index: 2;
    pointer-events: none;
}

.clear-btn,
.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.clear-btn:hover,
.toggle-password:hover {
    color: #6b7280;
    background: #f3f4f6;
    transform: scale(1.05);
}

.clear-btn {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.clear-btn.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.clear-btn:hover {
    color: #64748b;
    background: #f1f5f9;
}

.clear-btn:focus {
    outline: 2px solid #324673;
    outline-offset: 2px;
}

.clear-btn:active,
.toggle-password:active {
    color: #475569;
    background: #ffffff;
}

/* Ajustar posição dos botões nos campos de senha */
.password-field .clear-btn {
    right: 3rem;
    z-index: 3;
}

.password-field .toggle-password {
    right: 1rem;
    z-index: 4;
}

/* Borda de foco */
.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #324673;
    transition: width 0.3s ease;
}

.form-control:focus + .input-focus-border {
    width: 100%;
}

/* Navegação do formulário */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 4px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-height: 45px;
    position: relative;
    overflow: hidden;
    flex: 1;
    width: 150px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary,
.btn-success {
    color: white;
    background: linear-gradient(135deg, #324673 0%, #1e3a8a 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #2a3a5f;
}

.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus {
    border-color: #324673;
    box-shadow: none;
}

.btn-primary:active:not(:disabled),
.btn-success:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-height: 48px;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #324673 0%, #2a3a5f 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(50, 70, 115, 0.3);
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #2a3a5f 0%, #1e2a4a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(50, 70, 115, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 14px 0 rgba(50, 70, 115, 0.3);
}

.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(50, 70, 115, 0.2), 0 4px 14px 0 rgba(50, 70, 115, 0.3);
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: flex;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Ações do formulário */
.form-actions {
  text-align: center;
  margin-top: 16px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Links do formulário */
.form-links {
  text-align: center;
  margin-top: 0;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #324673;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    line-height: 1.4;
    margin-top: 10px;
}

.forgot-password:hover {
    color: #1e2a4a;
    background: #f8fafc;
    transform: translateY(-1px);
}

.footer {
    text-align: center;
    border-top: 2px solid #f1f5f9;
    padding: 0;
    font-size: 90%;
    margin-top: 0;
}

p {
    color: #72849a;
    line-height: 1.5;
}

.login-link {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 10px;
    line-height: 1.4;
}

.login-link-text {
    color: #324673;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    margin: 0;
    padding: 4px 8px;
    border-radius: 6px;
}

.login-link-text:hover {
    color: #1e2a4a;
    background: #f8fafc;
    transform: translateY(-1px);
}

.login-link-text:active {
    color: #1e2a4a;
    transform: translateY(0);
}

.register-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-top: 0.5rem;
    line-height: 1.2;
}

.register-link:hover {
    color: #374151;
    background: rgba(107, 114, 128, 0.1);
    transform: translateY(-1px);
}

.register-link i,
.forgot-password i {
    font-size: 13px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    margin-top: 4px;
}

/* Seção de verificação */
.verification-section {
    text-align: center;
}

.verification-header {
    margin-bottom: 2rem;
}

.verification-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.verification-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.verification-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verification-option {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.verification-option:hover {
    border-color: #324673;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.option-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.verification-option[data-metodo="email"] .option-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.verification-option[data-metodo="whatsapp"] .option-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.option-content {
    flex: 1;
    text-align: left;
}

.option-content h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.option-content p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.option-arrow {
    color: #9ca3af;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.verification-option:hover .option-arrow {
    color: #324673;
    transform: translateX(4px);
}

.verification-option-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.verification-option-disabled:hover {
    transform: none;
    border-color: #e5e7eb;
    background: white;
    box-shadow: none;
}

/* Seção de código */
.code-section {
    text-align: center;
}

.code-header {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.btn-back:hover {
    color: #374151;
    background: #f3f4f6;
}

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

.code-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #324673;
}

.code-message i {
    font-size: 1.5rem;
    color: #324673;
}

.message-content p {
    margin: 0;
    font-weight: 500;
    color: #374151;
}

.message-content span {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Inputs de código */
.code-input-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.code-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #999999;
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: #324673;
    background: white;
    box-shadow: 0 0 0 3px rgba(50, 70, 115, 0.1);
}

.code-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.code-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #dc2626;
    font-size: 0.9rem;
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 8px;
}

/* Feedback dos campos */
.field-feedback {
    font-size: 13px;
    color: #d9534f;
    margin-top: 0.25rem;
}

.field-feedback.valid {
    color: #324673;
}

.field-feedback.invalid {
    color: #dc2626;
}

.field-feedback.error {
    color: #dc2626;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-feedback.error::before {
    content: '⚠';
    font-size: 0.75rem;
}

.field-feedback.success {
    color: #324673;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-feedback.success::before {
    content: '✓';
    font-size: 0.75rem;
}

/* Modais */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-title i {
    color: #324673;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(50, 70, 115, 0.3);
}

/* Validação de campos */
.form-control.is-valid,
.form-control:valid,
.was-validated .form-control:valid {
    border-color: #324673;
    background: #f9fafb;
}

.form-control.is-valid:focus,
.form-control:valid:focus,
.was-validated .form-control:valid:focus {
    border-color: #324673;
    background: white;
    box-shadow: 0 0 0 3px rgba(50, 70, 115, 0.1);
}

.form-control.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-control.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsividade */
@media (max-width: 991.98px) {
    .form-wrapper {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .form-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767px) {
    .login-background {
        display: none;
    }
    
    .form-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .form-title {
        font-size: 1.75rem;
    }
    
    .code-input-container {
        gap: 0.5rem;
    }
    
    .code-input {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .verification-option {
        padding: 1rem;
    }
    
    .option-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .form-wrapper {
        padding: 16px;
    }
    
    .form-header {
        margin-bottom: 16px;
    }
    
    .logo {
        max-width: 120px;
        margin: 0 auto 12px auto;
        display: block !important;
    }
    
    .form-title {
        font-size: 20px;
        margin-bottom: 0.25rem;
    }
    
    .form-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-control {
        padding: 12px 14px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .input-wrapper {
        max-width: 100%;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
    }
    
    .btn-submit {
        padding: 12px 20px;
        min-height: 44px;
        font-size: 15px;
        margin: 12px auto 0 auto;
    }
    
    .form-footer {
        margin-top: 16px;
        padding-top: 12px;
    }
    
    .login-link {
        font-size: 0.8rem;
        margin-top: 8px;
    }
    
    .login-link-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }
    
    .login-form-section {
        padding: 1.5rem 1rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .code-input {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

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

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.form-container {
    animation: fadeIn 0.6s ease-out;
}

.verification-option {
    animation: slideIn 0.4s ease-out;
}

.verification-option:nth-child(2) {
    animation-delay: 0.1s;
}

/* Estados de loading */
.loading-spinner {
    animation: spin 1s linear infinite;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Estados selecionados */
.verification-option.selected {
    border-color: #324673;
    background: #f0f4ff;
    transform: scale(1.02);
}

/* Melhorias de acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#close_modal1 {
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    position: absolute;
    top: 12px;
    right: 15px;
    line-height: 1;
}

#close_modal1:hover {
    color: #e74c3c; /* Vermelho no hover */
    transform: scale(1.1);
}

#close_modal1:focus {
    outline: none;
}

/* Estilos para validação visual da senha */
.senha_nova {
    margin-top: 16px;
}

.senha_nova .d-flex div {
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.senha_nova .text-danger i,
.senha_nova .text-success i {
    margin-right: 0.5rem;
    font-size: 12px;
}

.senha_nova .text-danger {
    color: #dc3545; 
}

.senha_nova .text-success {
    color: #28a745; 
}

.senha_nova .text-muted {
    font-size: 13px;
    color: #6b7280;
}

main {
    margin-bottom: 0;
    padding-bottom: 0;
}

.cadastro-container main {
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-links:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.footer:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}