:root{
    --md-primary-color:#3f51b5;
    --md-secondary-color:#fff;
    --md-background-color:#f0f4f9;
    --md-text-color:#333;
    --md-hint-color:#666;
    --md-border-color:#ccc;
    --md-error-color:#d32f2f;
    --md-success-color:#388e3c;
}
.md-cadastro-container{
    font-family: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.md-box{
    display: grid;
    width: 1100px;
    /* max-width: 70%; */
    /* overflow: hidden; */
    height: 800px;
    gap: 100px;
    grid-template-columns: 2fr 2fr;
    align-items: stretch;
}

/* Logo Mobile */
.md-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}
.md-mobile-logo img {
    max-width: 200px;
    height: auto;
}

input, select, textarea {
    height: 50px !important;
}
.md-visual-panel{
    flex:1;
    padding:30px;
    color:#fff;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    position:relative;
    border-radius: 20px;
}
.md-visual-panel::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    z-index:1;
    transition:opacity 0.3s ease;
}
.md-visual-panel.has-image::before{
    opacity:0;
}
.md-visual-panel > *{
    position:relative;
    z-index:2;
}
.md-form-panel{
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 20px;
    justify-content: space-between;
}
#md-form-title{
    font-size: 36px;
    margin-bottom: 40px;
}
.md-form-group{
    margin-bottom:20px;
}
.md-form-row{
    display:flex;
    gap:12px;
}
.md-form-group label{
    display:block;
    margin-bottom:6px;
    font-weight:600;
    color:var(--md-text-color);
}
.md-form-group input[type=text],
.md-form-group input[type=email],
.md-form-group input[type=password],
.md-form-group select{
    width:100%;
    padding:12px;
    border:1px solid var(--md-border-color);
    border-radius:6px;
    font-size:15px;
    box-sizing:border-box;
    transition:all 0.3s ease;
}
.md-form-group select{
    background-color:white;
    cursor:pointer;
    appearance:none;
    background-image:url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat:no-repeat;
    background-position:right 12px center;
    padding-right:40px;
}
.md-form-group select:focus,
.md-form-group input:focus{
    outline:none;
    border-color:var(--md-primary-color);
    box-shadow:0 0 0 2px rgba(63,81,181,0.2);
}
.md-form-group input.error{
    border-color:var(--md-error-color);
}
.md-btn{
    padding:12px 24px;
    border-radius:6px;
    border:none;
    cursor:pointer;
    font-size:15px;
    font-weight:500;
    transition:all 0.2s ease;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}
.md-btn:disabled{
    opacity:0.6;
    cursor:not-allowed;
}
.md-btn-primary{
    background: #27364A;
    color: #fff;
    float: inline-end;
}
.md-btn-primary:hover{
    background: #27364A !important;
    color: #fff !important;
    float: inline-end !important;
    transform: none !important;
}
.md-btn-primary:hover:not(:disabled) {
    background: #27364A !important;
    color: #fff !important;
    float: inline-end !important;
    transform: none !important;
}
.md-btn-primary:hover:not(:disabled){
    background:#303f9f;
    transform: none !important;
    /* transform:translateY(-1px); */
}
.md-btn-secondary{
    background:#fff;
    border:1px solid var(--md-primary-color);
    color:var(--md-primary-color);
}
.md-btn-secondary:hover:not(:disabled){
    background:#fff;
    border:1px solid var(--md-primary-color);
    color:var(--md-primary-color);
}
.md-progress-container{
    display:flex;
    align-items:center;
    margin-bottom:80px;
}
.md-progress-blocks{
    display:flex;
    gap:6px;
    margin-right:12px;
}
.md-progress-blocks .md-block{
    height:6px;
    background: hsl(231deg 48% 48% / 25%);
    border-radius:3px;
    width:71px;
    transition:background 0.3s ease;
}
.md-progress-blocks .md-block.md-active{
    background:var(--md-primary-color);
}
.md-step-indicator{
    font-size:16px;
    color:#27364A;
    margin:0 !important;
}
.md-terms{
    font-size: 16px;
    color: #666;
    margin-top: 23px;
    margin-bottom: 33px !important;
}
.md-terms a{
    color:var(--md-primary-color);
    text-decoration:none;
}
.md-terms a:hover{
    text-decoration:underline;
}
.md-crm-display{
    font-size:16px;
    color:var(--md-text-color);
    margin-bottom:25px;
    font-weight:500;
}
.md-login-info{
    background: #f0f4f9;
    padding: 12px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 14px;
    text-align:center;
}
.md-login-info strong{
    color:var(--md-primary-color);
}
.md-form-actions{
    display:flex;
    justify-content:space-between;
    margin-top:48px;
    gap:12px;
}
.md-logo{
    margin-bottom:20px;
}

.md-cpf-error {
    color: #dc3545;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}
.md-message{
    margin-top:16px;
    padding:14px;
    border-radius:6px;
    display:none;
    text-align:center;
}
.md-message.success{
    background:#d4edda;
    color:#155724;
    border:1px solid #c3e6cb;
}
.md-message.error{
    background:#f8d7da;
    color:#721c24;
    border:1px solid #f5c6cb;
}
.md-already-logged{
    text-align:center;
    padding:40px;
    background:white;
    border-radius:14px;
    box-shadow:0 4px 20px rgba(0,0,0,0.1);
    max-width:400px;
    margin:40px auto;
}
.md-loading{
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(255,255,255,0.9);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    z-index:1000;
}
.md-spinner{
    width:40px;
    height:40px;
    border:4px solid #f3f3f3;
    border-top:4px solid var(--md-primary-color);
    border-radius:50%;
    animation:md-spin 1s linear infinite;
    margin-bottom:16px;
}
@keyframes md-spin{
    0%{transform:rotate(0deg)}
    100%{transform:rotate(360deg)}
}
.md-step{
    animation:fadeIn 0.3s ease;
}
@keyframes fadeIn{
    from{opacity:0;transform:translateY(10px)}
    to{opacity:1;transform:translateY(0)}
}
.md-crm-error{
    color:var(--md-error-color);
    font-size:14px;
    margin-top:8px;
    display:block;
}

/* Estilos para ícones SVG */
.md-btn-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}
.md-btn-icon-left {
    width: 16px;
    height: 16px;
}
.md-btn-icon-right {
    width: 16px;
    height: 16px;
}
.md-btn-icon-check {
    width: 16px;
    height: 16px;
}
.md-btn-icon-user {
    width: 16px;
    height: 16px;
}

.md-step-success ul {
    list-style: none;
    font-size: 20px;
    color: #27364A;
    line-height: 200%;
    margin: 0px !important;
}

.md-step-success ul li img {
    margin-top: -3px;
}

.md-step-success p {
    font-size: 20px;
    color: #27364A;
    margin-top: 65px
}

/* Texto de login no rodapé */
.md-login-footer {
    margin-top: 30px;
    padding: 20px 0;
    font-size: 16px;
    color: #666;
    border-top: 1px solid #eee;
}

.md-login-footer a {
    color: var(--md-primary-color);
    text-decoration: none;
    font-weight: 500;
}

.md-login-footer a:hover {
    text-decoration: underline;
}

/* Estilo para erro de senha não coincidente */
.md-password-error {
    color: var(--md-error-color);
    font-size: 14px;
    margin-top: 8px;
    display: block;
}

/* Novos estilos para o step 3 */
.md-nome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.md-nome-header label {
    margin-bottom: 0 !important;
}

.md-edit-nome-btn-2 {
    background: none;
    border: none;
    color: #0000FF;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.md-edit-nome-btn-2 {
    background: none !important;
    border: none !important;
    color: #0000FF !important;
    cursor: pointer !important;
    font-size: 16px !important;
    padding: 0 !important;
}


.md-nome-completo-disabled {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Adicione no seu arquivo CSS */
.md-nome-completo-disabled {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
}

.md-nome-completo-enabled {
    background-color: #ffffff !important;
    border: 2px solid #007cba !important;
    cursor: text !important;
}

.md-edit-nome-btn-2 {
    background: transparent;
    border: 1px solid #007cba;
    color: #007cba;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.md-edit-nome-btn-2:hover {
    background: #007cba;
    color: white;
}

/* .md-cancel-edit-btn {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
} */

/* .md-cancel-edit-btn:hover {
    background: #c82333;
    border-color: #bd2130;
} */

#md-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-loading-content {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.md-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 10px;
}

.md-loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

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

/* ===== VERSÃO MOBILE ===== */
@media(max-width: 1024px){
    .md-box{
        max-width: 90%;
        gap: 50px;
    }
}

/* Estilos para mensagens de email */
.md-email-success {
    color: #28a745;
    font-size: 14px;
    display: block;
    margin-top: 4px;
}

.md-email-error {
    color: #dc3545;
    font-size: 14px;
    display: block;
    margin-top: 4px;
}

.md-password-error {
    color: #dc3545;
    font-size: 14px;
    display: block;
    margin-top: 4px;
}


@media(max-width: 800px){
    .md-cadastro-container{
        font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
        flex-direction: column;
        min-height: 50vh;
    }
    
    .md-mobile-logo {
        display: block;
        margin-bottom: 20px;
        padding-top: 20px;
    }
    
    .md-box{
        flex-direction: column;
        max-width: 100%;
        height: auto;
        gap: 0;
    }
    
    .md-visual-panel{
        display: none !important;
    }
    
    .md-form-panel{
        width: 100%;
        max-width: 100%;
    }

    
    
    #md-form-title{
        font-size: 36px;
        text-align: center;
        margin-bottom: 30px;
        color: #27364A;;
    }
    
    .md-progress-container{
        margin-bottom: 40px;
        justify-content: center;
    }
    
    .md-progress-blocks{
        margin-right: 15px;
    }
    
    .md-step-indicator{
        font-size: 14px;
    }
    
    .md-form-row{
        flex-direction: column;
        gap: 15px;
    }
    
    .md-form-group{
        margin-bottom: 25px;
    }
    
    .md-form-group input[type=text],
    .md-form-group input[type=email],
    .md-form-group input[type=password],
    .md-form-group select{
        font-size: 16px; /* Melhor para mobile */
        padding: 15px;
    }
    
    .md-terms{
        font-size: 14px;
        margin: 20px 0;
        text-align: initial;
    }
    
    .md-form-actions{
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }
    
    .md-btn{
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
    
    /* Ajustes específicos para o step 4 mobile */
    .md-step-success ul {
        font-size: 16px;
        line-height: 180%;
        padding-left: 0;
    }
    
    .md-step-success ul li {
        margin-bottom: 15px;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 16px;
    }
    
    .md-step-success ul li img {
        width: 20px;
        height: 20px;
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    .md-step-success p {
        font-size: 18px;
        margin-top: 30px;
        text-align: center;
    }
    
    /* Ajustes para mensagens mobile */
    .md-message{
        margin-top: 20px;
        padding: 15px;
        font-size: 14px;
    }
    
    /* Loading mobile */
    .md-loading p{
        font-size: 16px;
    }
    
    /* Login footer mobile */
    .md-login-footer {
        margin-top: 20px;
        padding: 15px 0;
        font-size: 14px;
    }
}

@media(max-width: 480px){
    .md-form-actions-2, .md-form-actions-1 {
        flex-direction: column-reverse !important;
    }
    .md-cadastro-container{
        padding: 5px;
    }
    
    #md-form-title{
        font-size: 36px;
        margin-bottom: 25px;
    }
    
    .md-progress-container{
        margin-bottom: 30px;
    }
    
    .md-progress-blocks .md-block{
        width: 50px;
    }
    
    .md-step-success ul {
        font-size: 14px;
        line-height: 170%;
    }
    
    .md-step-success p {
        font-size: 20px;
        margin-top: 25px;
        text-align: initial;
        margin-bottom: 25px !important;
    }
    
    .md-mobile-logo img {
        max-width: 150px;
    }
    
    .md-login-footer {
        font-size: 13px;
        padding: 10px 0;
    }
}

/* Ajustes para tablets em modo retrato */
@media(max-width: 768px) and (orientation: portrait){
    .md-box{
        max-width: 95%;    
        grid-template-columns: 1fr;
    }
}