/* =====================
   RESET E CONFIGURAÇÕES BÁSICAS
   ===================== */
*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(120deg, #009ef7 0%, #6171ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    padding: 20px;
}

/* =====================
   CONTAINER PRINCIPAL
   ===================== */
.reset-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    padding: clamp(25px, 4vw, 40px) clamp(20px, 3vw, 30px);
    width: 100%;
    max-width: clamp(320px, 85vw, 500px);
    animation: fadeInDown 0.8s cubic-bezier(.68, -0.55, .27, 1.55);
    text-align: center;
    position: relative;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================
   TÍTULOS E TEXTOS
   ===================== */
.reset-container h2 {
    color: #0e90dc;
    font-size: clamp(20px, 3vw, 25px);
    margin-bottom: clamp(8px, 1.5vw, 10px);
    font-weight: 600;
}

.reset-container label {
    display: block;
    margin-top: clamp(20px, 3vw, 30px);
    margin-bottom: clamp(4px, 0.8vw, 6px);
    color: #444;
    font-weight: 500;
    text-align: left;
    font-size: clamp(14px, 1.8vw, 16px);
}

/* =====================
   INPUTS
   ===================== */
.reset-container input {
    border: 1px solid #cfd8dc;
    background: #f7f8fa;
    outline: none;
    font-size: clamp(16px, 2.2vw, 20px);
    padding: clamp(12px, 2vw, 15px) clamp(30px, 4vw, 36px) clamp(12px, 2vw, 15px) clamp(8px, 1.2vw, 10px);
    width: 100%;
    box-sizing: border-box;
    color: #000;
    border-radius: 8px;
    margin-bottom: clamp(18px, 2.5vw, 22px);
    box-shadow: 0 1px 4px rgba(31, 38, 135, 0.07);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.reset-container input:focus {
    color: #073048;
    box-shadow: 0 0 0 2px #009ef7;
    border-color: #009ef7;
}

/* Input específico para código */
#codigo {
    border: 1px solid #bfcbdf;
    background: #dbebff;
    outline: none;
    font-size: clamp(24px, 3.5vw, 28px);
    padding: clamp(15px, 2.5vw, 18px) 0;
    width: 100%;
    color: #333;
    text-align: center;
    letter-spacing: clamp(6px, 1.2vw, 10px);
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: clamp(18px, 2.5vw, 22px);
}

/* =====================
   TOGGLE PASSWORD
   ===================== */
.toggle-password {
    position: absolute !important;
    right: clamp(15px, 2vw, 20px);
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    font-size: clamp(16px, 2vw, 18px);
    z-index: 2;
    height: clamp(20px, 2.5vh, 24px);
    display: flex;
    align-items: center;
}

/* =====================
   BOTÕES
   ===================== */
.reset-container button {
    width: 100%;
    background: linear-gradient(90deg, #009ef7 0%, #6171ff 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: clamp(12px, 2vw, 15px) 0;
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 600;
    margin-top: clamp(8px, 1.2vw, 10px);
    cursor: pointer;
    box-shadow: 0 4px 16px 0 rgba(97, 113, 255, 0.10);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}

.reset-container button:hover {
    background: linear-gradient(90deg, #6171ff 0%, #009ef7 100%);
    transform: translateY(-2px) scale(1.03);
}

#btn_voltar {
    width: 100%;
    background: linear-gradient(90deg, #dbe8f9 0%, #dcdef7 100%);
    color: #6c6c6c;
    border: none;
    border-radius: 8px;
    padding: clamp(12px, 2vw, 15px) 0;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 600;
    margin-top: clamp(16px, 2.5vw, 20px);
    cursor: pointer;
    box-shadow: 0 4px 16px 0 rgba(97, 113, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1vw, 8px);
    font-family: 'Poppins', sans-serif;
}

#btn_voltar:hover {
    background: linear-gradient(90deg, #cbd9ec 0%, #ccceec 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px 0 rgba(97, 113, 255, 0.3);
}

/* =====================
   BOTÕES LINK
   ===================== */
.btn-link {
    background: none !important;
    border: none !important;
    color: #009ef7 !important;
    text-decoration: underline;
    cursor: pointer;
    font-size: clamp(14px, 1.8vw, 16px) !important;
    font-weight: 500 !important;
    padding: clamp(8px, 1vw, 10px) !important;
    margin: 0 !important;
    width: auto !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #6171ff !important;
    background: none !important;
    transform: none !important;
    text-decoration: none;
}

.btn-link:disabled {
    color: #999 !important;
    cursor: not-allowed;
}

/* =====================
   CONTADOR E MENSAGENS
   ===================== */
#countdown-display {
    padding: clamp(10px, 1.5vw, 12px);
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    margin-bottom: clamp(15px, 2vw, 18px);
    border-left: 4px solid #009ef7;
}

#countdown-display .fas {
    color: #009ef7;
    margin-right: clamp(6px, 0.8vw, 8px);
}

.text-muted {
    color: #666 !important;
}

.small {
    font-size: clamp(13px, 1.6vw, 15px) !important;
}

#resend-container {
    padding: clamp(10px, 1.5vw, 12px);
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* =====================
   FEEDBACK
   ===================== */
.feedback {
    margin-top: clamp(10px, 1.5vw, 12px);
    color: #e44a5c;
    font-size: clamp(14px, 1.8vw, 16px);
    min-height: clamp(18px, 2.5vh, 22px);
}

/* =====================
   TOAST CUSTOMIZAÇÃO
   ===================== */
.iziToast-wrapper.iziToast-wrapper-center {
    transform: translateY(-40%) !important;
}

/* =====================
   MEDIA QUERIES RESPONSIVAS E ZOOM
   ===================== */

/* 1920x1080 com zoom 125% (viewport efetivo ~1536px) */
@media screen and (min-width: 1500px) and (max-width: 1600px) {
    .reset-container {
        max-width: 420px;
        padding: 28px 22px;
    }

    .reset-container h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .reset-container label {
        font-size: 13px;
        margin-top: 22px;
        margin-bottom: 5px;
    }

    #email_instructions {
        font-size: 13px !important;
    }

    .reset-container input {
        font-size: 14px;
        padding: 9px 30px 9px 9px;
        margin-bottom: 18px;
    }

    #codigo {
        font-size: 20px;
        padding: 11px 0;
        letter-spacing: 8px;
        margin-bottom: 18px;
    }

    .reset-container button {
        font-size: 13px;
        padding: 9px 0;
        margin-top: 9px;
    }

    #btn_voltar {
        font-size: 13px;
        padding: 9px 0;
        margin-top: 18px;
    }

    .feedback {
        font-size: 13px;
        margin-top: 10px;
        min-height: 20px;
    }

    .toggle-password {
        right: 18px;
        font-size: 14px;
        height: 22px;
    }
}

/* Zoom 110% */
@media screen and (min-width: 1700px) and (max-width: 1800px) {
    .reset-container {
        max-width: clamp(440px, 40vw, 480px);
    }
}

/* Zoom 125% - Genérico para outras resoluções */
@media screen and (min-width: 1400px) and (max-width: 1500px) {
    .reset-container {
        max-width: clamp(380px, 45vw, 440px);
    }
}

/* Zoom 150% */
@media screen and (min-width: 1200px) and (max-width: 1400px) {
    .reset-container {
        max-width: clamp(360px, 50vw, 420px);
    }
}

/* Zoom 175% */
@media screen and (min-width: 1000px) and (max-width: 1200px) {
    .reset-container {
        max-width: clamp(340px, 55vw, 400px);
    }
}

/* Zoom 200% */
@media screen and (min-width: 800px) and (max-width: 1000px) {
    .reset-container {
        max-width: clamp(320px, 60vw, 380px);
    }
}

/* Tablets grandes e desktops pequenos */
@media (max-width: 1024px) {
    body {
        padding: 15px;
    }

    .reset-container {
        max-width: 90vw;
        padding: clamp(20px, 3vw, 30px) clamp(15px, 2vw, 20px);
    }

    .reset-container h2 {
        font-size: clamp(18px, 3vw, 22px);
    }

    .iziToast-wrapper.iziToast-wrapper-center {
        transform: translateY(-45%) !important;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .reset-container {
        max-width: 95vw;
        padding: clamp(18px, 3vw, 25px) clamp(12px, 2vw, 18px);
    }

    .reset-container h2 {
        font-size: clamp(16px, 4vw, 20px);
    }

    .reset-container input {
        font-size: clamp(14px, 3vw, 18px);
        padding: clamp(11px, 2vw, 14px) clamp(25px, 4vw, 32px) clamp(11px, 2vw, 14px) clamp(7px, 1.5vw, 9px);
    }

    #codigo {
        font-size: clamp(20px, 4vw, 26px);
        letter-spacing: clamp(4px, 1.5vw, 8px);
    }

    .reset-container button {
        font-size: clamp(14px, 3vw, 18px);
        padding: clamp(11px, 2vw, 14px) 0;
    }

    #btn_voltar {
        font-size: clamp(14px, 3vw, 16px);
        padding: clamp(11px, 2vw, 14px) 0;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 5vh;
    }

    .reset-container {
        max-width: 100%;
        padding: 20px 15px;
        border-radius: 12px;
    }

    .reset-container h2 {
        font-size: clamp(14px, 5vw, 18px);
    }

    .reset-container label {
        font-size: clamp(12px, 3vw, 14px);
        margin-top: clamp(15px, 4vw, 20px);
    }

    .reset-container input {
        font-size: clamp(12px, 4vw, 16px);
        padding: clamp(10px, 3vw, 13px) clamp(20px, 5vw, 28px) clamp(10px, 3vw, 13px) clamp(6px, 2vw, 8px);
        margin-bottom: clamp(15px, 3vw, 18px);
    }

    #codigo {
        font-size: clamp(18px, 5vw, 22px);
        padding: clamp(12px, 3vw, 15px) 0;
        letter-spacing: clamp(3px, 1vw, 6px);
    }

    .reset-container button {
        font-size: clamp(12px, 4vw, 16px);
        padding: clamp(10px, 3vw, 13px) 0;
        margin-top: clamp(6px, 2vw, 8px);
    }

    #btn_voltar {
        font-size: clamp(12px, 4vw, 14px);
        padding: clamp(10px, 3vw, 13px) 0;
        margin-top: clamp(12px, 3vw, 16px);
    }

    .feedback {
        font-size: clamp(11px, 3vw, 13px);
        margin-top: clamp(8px, 2vw, 10px);
        min-height: clamp(15px, 4vh, 18px);
    }

    .toggle-password {
        right: clamp(12px, 3vw, 15px);
        font-size: clamp(14px, 4vw, 16px);
        height: clamp(18px, 4vh, 20px);
    }
}

/* Smartphones pequenos */
@media (max-width: 360px) {
    .reset-container {
        padding: 15px 10px;
        border-radius: 8px;
    }

    .reset-container h2 {
        font-size: clamp(12px, 5vw, 16px);
    }

    .reset-container input {
        font-size: clamp(11px, 4vw, 14px);
    }

    #codigo {
        font-size: clamp(16px, 5vw, 20px);
    }

    .reset-container button {
        font-size: clamp(11px, 4vw, 14px);
    }

    #btn_voltar {
        font-size: clamp(11px, 4vw, 13px);
    }
}

/* =====================
   ESTADOS E TRANSIÇÕES
   ===================== */

/* Focus states melhorados */
.reset-container input:focus {
    transform: scale(1.02);
}

/* Loading states */
.reset-container button:disabled,
#btn_voltar:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
}

.reset-container button:disabled:hover,
#btn_voltar:disabled:hover {
    background: #ccc !important;
    transform: none !important;
}

/* =====================
   ACESSIBILIDADE
   ===================== */

/* Redução de movimento para usuários sensíveis */
@media (prefers-reduced-motion: reduce) {
    .reset-container {
        animation: none;
    }

    .reset-container button,
    #btn_voltar {
        transition: background-color 0.2s ease;
    }

    .reset-container button:hover,
    #btn_voltar:hover {
        transform: none;
    }

    .reset-container input:focus {
        transform: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .reset-container {
        border: 3px solid #000;
    }

    .reset-container input {
        border: 2px solid #000;
    }

    .reset-container button,
    #btn_voltar {
        border: 2px solid #000;
    }
}

/* =====================
   LOADER
   ===================== */

/* Centered loading overlay (shared) - ensure forgot_password can use the same loader markup */
.cadastro-loader {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
}

.cadastro-loader .loader-box {
    background: rgba(255,255,255,0.95);
    padding: 18px 22px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(31,38,135,0.12);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cadastro-loader .spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 4px solid rgba(9,158,247,0.15);
    border-top-color: #009ef7;
    animation: spin 1s linear infinite;
}

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

.cadastro-loader .loader-text {
    color: #073048;
    font-weight: 600;
    font-size: 14px;
}