*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

[x-cloak] { display: none !important; }

.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Painel esquerdo - imagem */
.auth-image-panel {
    display: none;
    background-image: linear-gradient(-225deg, #231557 0%, #44107A 29%, rgba(255, 19, 97, 0.75) 100%);
    overflow: hidden;
}

.auth-image-panel img {
    width: 60%;
    max-width: 450px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    animation: floatImg 6s ease-in-out infinite;
}

@keyframes floatImg {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.auth-image-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
}

.auth-image-content h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    letter-spacing: -.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
}

.auth-image-content p {
    color: rgba(255,255,255,.75);
    font-size: .875rem;
    margin: 0;
    line-height: 1.55;
}

.auth-image-badge {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 1rem;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
}

.auth-image-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 8px rgba(34,211,238,.8);
    flex-shrink: 0;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 8px rgba(34,211,238,.8); }
    50%      { box-shadow: 0 0 14px rgba(34,211,238,1); }
}

/* Painel direito - formulário */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    flex-shrink: 0;
    padding: 2.5rem 1.25rem;
    position: relative;
    overflow: hidden;
    background: #eef1f8;
}

.auth-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0,0,0,0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%);
}

@media (min-width: 900px) {
    .auth-image-panel {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 55%;
    }

    .auth-form-panel {
        margin-left: 55%;
        width: 45%;
        max-width: 45%;
        min-height: 100vh;
        padding: 2.5rem 2rem;
    }
}

/* Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    animation: blobFloat 14s ease-in-out infinite;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, -25px) scale(1.06); }
}

/* Card */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 1.5rem;
    padding: 2.5rem;
    position: relative;
    z-index: 10;
    box-shadow:
        0 0 0 1px rgba(107,33,168,0.06),
        0 1px 2px rgba(15,23,42,0.04),
        0 24px 48px -16px rgba(15,23,42,0.18);
    animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,0.5), transparent);
}

/* Inputs */
.auth-input {
    width: 100%;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    color: #1e293b !important;
    padding: 0.75rem 1rem 0.75rem 2.75rem !important;
    font-size: 0.9rem !important;
    transition: border-color .2s, box-shadow .2s, background-color .2s !important;
    font-family: var(--font-sans) !important;
}

.auth-input::placeholder { color: #94a3b8 !important; }

.auth-input:hover {
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
}

.auth-input:focus {
    outline: none !important;
    border-color: #a78bfa !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12) !important;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1e293b !important;
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Botão de mostrar/ocultar senha */
.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color .2s, background-color .2s, transform .15s;
}

.toggle-password:hover {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.08);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.94);
}

.toggle-password:focus-visible {
    outline: 2px solid rgba(139,92,246,0.5);
    outline-offset: 2px;
}

/* Botão submit */
.btn-submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    background-size: 200% 200%;
    background-position: 0% 50%;
    border: none;
    border-radius: 0.875rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background-position .5s ease, opacity .2s;
    box-shadow: 0 4px 18px rgba(139,92,246,0.35);
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(139,92,246,0.45);
    background-position: 100% 50%;
}

.btn-submit:hover:not(:disabled)::after {
    transform: translateX(100%);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(139,92,246,0.4);
}

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

/* Ícone à esquerda dentro do input */
.input-icon {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color .2s;
    display: inline-flex;
}

.auth-input:focus ~ .input-icon,
.position-relative:focus-within .input-icon {
    color: #7c3aed;
}

/* Indicador de força da senha (reset_password) */
.strength-meter {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.strength-track {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width .3s ease, background-color .3s ease;
}

.strength-fill.lvl-0 { background: #cbd5e1; }
.strength-fill.lvl-1 { background: #ef4444; }
.strength-fill.lvl-2 { background: #f59e0b; }
.strength-fill.lvl-3 { background: #3b82f6; }
.strength-fill.lvl-4 { background: #10b981; }

.strength-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    min-width: 70px;
    text-align: right;
}

.strength-label.lvl-0 { color: #94a3b8; }
.strength-label.lvl-1 { color: #ef4444; }
.strength-label.lvl-2 { color: #d97706; }
.strength-label.lvl-3 { color: #2563eb; }
.strength-label.lvl-4 { color: #059669; }

.password-hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Feedback de coincidência das senhas */
.match-hint {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    font-weight: 500;
    color: #059669;
}

.match-hint.nomatch { color: #dc2626; }

.auth-input.is-match:not(:focus) {
    border-color: #6ee7b7 !important;
    background: #f0fdf4 !important;
}

.auth-input.is-nomatch:not(:focus) {
    border-color: #fecaca !important;
    background: #fef2f2 !important;
}

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

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

/* Acessibilidade: usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-image-panel img,
    .auth-image-badge .dot,
    .blob,
    .btn-submit::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Mobile fine-tuning */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 1.25rem;
    }
}
