/* ================================================================
   LOGIN PAGE — PJzen
   Design consistente com o sistema (Bootstrap 5 + MudBlazor)
   Primary: #2563eb  |  Font: Roboto
================================================================ */

/* ── Reset página ─────────────────────────────────────────────── */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* ── Shell: duas colunas ──────────────────────────────────────── */
.login-shell {
    display: flex;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   PAINEL ESQUERDO — branding com gradiente azul
══════════════════════════════════════════════════════════════ */
.login-brand {
    flex: 1;
    background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 45%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

/* Círculos decorativos de fundo */
.login-brand::before,
.login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.login-brand::before {
    width: 500px; height: 500px;
    top: -200px; right: -120px;
}
.login-brand::after {
    width: 350px; height: 350px;
    bottom: -130px; left: -100px;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
}

/* Logo */
.login-logo {
    width: 160px;
    margin-bottom: 3rem;
    filter: brightness(0) invert(1);
}

/* Tagline */
.login-brand-tagline h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: .75rem;
}
.login-brand-tagline p {
    color: rgba(255,255,255,.75);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Cards decorativos */
.login-deco {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: 2.5rem;
}

.login-deco-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.login-deco-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.login-deco-num {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}
.login-deco-label {
    color: rgba(255,255,255,.72);
    font-size: .78rem;
}

/* ══════════════════════════════════════════════════════════════
   PAINEL DIREITO — formulário
══════════════════════════════════════════════════════════════ */
.login-form-panel {
    width: 480px;
    min-width: 480px;
    background: var(--mud-palette-background, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-form-wrap {
    width: 100%;
    max-width: 380px;
}

/* Logo mobile (oculta no desktop) */
.login-mobile-logo {
    display: none;
    margin-bottom: 2rem;
    text-align: center;
}
.login-mobile-logo img {
    height: 40px;
}

/* Título */
.login-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary, #111827);
    margin: 0 0 .35rem;
    line-height: 1.3;
}

.login-subtitle {
    font-size: .9rem;
    color: var(--mud-palette-text-secondary, #6b7280);
    margin: 0 0 1.75rem;
}

/* ── Alerta de erro ────────────────────────────────────────── */
.login-alert {
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}
.login-alert-error {
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.25);
    color: #dc2626;
}

/* ── Campos ────────────────────────────────────────────────── */
.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.login-field {
    display: flex;
    flex-direction: column;
}

.login-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary, #374151);
    margin-bottom: .45rem;
}

/* Wrapper com ícone */
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--mud-palette-divider, #d1d5db);
    border-radius: 10px;
    background: var(--mud-palette-surface, #fff);
    transition: border-color .2s, box-shadow .2s;
}
.login-input-wrap:hover {
    border-color: #93c5fd;
}
.login-input-wrap.focused {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-input-wrap.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.login-input-icon {
    position: absolute;
    left: .875rem;
    color: var(--mud-palette-text-secondary, #9ca3af);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.login-input {
    width: 100%;
    padding: .7rem .875rem .7rem 2.5rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--mud-palette-text-primary, #111827);
    font-family: 'Roboto', sans-serif;
    font-size: .925rem;
    outline: none;
    appearance: none;
}
.login-input::placeholder {
    color: #9ca3af;
}
.login-input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Botão olho (senha) */
.login-eye-btn {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.login-eye-btn:hover { color: #2563eb; }

/* Mensagem de erro por campo */
.login-field-error {
    font-size: .78rem;
    color: #ef4444;
    margin-top: .3rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ── Lembrar-me ────────────────────────────────────────────── */
.login-remember {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .875rem;
    color: var(--mud-palette-text-primary, #374151);
    cursor: pointer;
    user-select: none;
}

.login-check {
    width: 16px; height: 16px;
    border-radius: 4px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Esqueci minha senha ───────────────────────────────────── */
.login-forgot {
    font-size: .82rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
}
.login-forgot:hover { color: #1d4ed8; text-decoration: underline; }

/* ── Botão Entrar ──────────────────────────────────────────── */
.login-btn-primary {
    width: 100%;
    padding: .8rem 1.5rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: background .2s, box-shadow .2s, transform .1s;
    margin-top: .25rem;
}
.login-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.login-btn-primary:active:not(:disabled) { transform: scale(.98); }
.login-btn-primary:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* Spinner inline no botão */
.login-spinner {
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Rodapé ────────────────────────────────────────────────── */
.login-footer-text {
    text-align: center;
    font-size: .82rem;
    color: var(--mud-palette-text-secondary, #6b7280);
    margin-top: 1.5rem;
    margin-bottom: 0;
}
.login-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.login-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════════════════════ */
.mud-dark .login-form-panel {
    background: var(--mud-palette-background);
}
.mud-dark .login-input-wrap {
    background: var(--mud-palette-surface);
    border-color: var(--mud-palette-divider);
}
.mud-dark .login-input {
    color: var(--mud-palette-text-primary);
}
.mud-dark .login-mobile-logo img {
    filter: brightness(0) invert(1);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO — tablet/mobile
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .login-brand { display: none; }

    .login-form-panel {
        width: 100%;
        min-width: 0;
        padding: 2.5rem 1.5rem;
    }

    .login-mobile-logo { display: block; }
}

@media (max-width: 480px) {
    .login-form-panel { padding: 2rem 1.25rem; }
    .login-title { font-size: 1.4rem; }
}

/* ══════════════════════════════════════════════════════════════
   ESQUECI A SENHA — componentes específicos
══════════════════════════════════════════════════════════════ */

/* ── Indicador de etapas ──────────────────────────────────── */
.es-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.es-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

.es-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid #d1d5db;
    background: #f9fafb;
    color: #9ca3af;
    font-size: .85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
}

.es-step-label {
    font-size: .72rem;
    color: #9ca3af;
    font-weight: 500;
    transition: color .25s;
    white-space: nowrap;
}

.es-step-active .es-step-circle {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}
.es-step-active .es-step-label { color: #2563eb; font-weight: 600; }

.es-step-done .es-step-circle {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}
.es-step-done .es-step-label { color: #2563eb; }

.es-step-connector {
    width: 48px;
    height: 2.5px;
    background: #e5e7eb;
    margin: 0 4px;
    margin-bottom: 22px;
    border-radius: 2px;
    transition: background .25s;
    flex-shrink: 0;
}
.es-connector-done { background: #2563eb; }

/* ── Caixas de dígito do código ───────────────────────────── */
.es-code-wrap {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin: .25rem 0 .5rem;
}

.es-digit {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #1e3a8a;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    caret-color: #2563eb;
}

.es-digit:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.es-digit-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* ── Countdown reenvio ────────────────────────────────────── */
.es-countdown {
    color: #9ca3af;
    font-size: .82rem;
    font-weight: 500;
}

/* ── Botão-link (reenviar código) ─────────────────────────── */
.es-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* ── Indicador de força de senha ──────────────────────────── */
.es-strength-bar {
    height: 4px;
    border-radius: 3px;
    background: #e5e7eb;
    margin-top: .45rem;
    overflow: hidden;
}

.es-strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .3s, background .3s;
}

.es-strength-fill.es-strength-fraca  { width: 33%;  background: #ef4444; }
.es-strength-fill.es-strength-media  { width: 66%;  background: #f59e0b; }
.es-strength-fill.es-strength-forte  { width: 100%; background: #22c55e; }

.es-strength-label {
    font-size: .75rem;
    font-weight: 600;
    display: block;
    margin-top: .2rem;
}
.es-strength-label-fraca  { color: #ef4444; }
.es-strength-label-media  { color: #f59e0b; }
.es-strength-label-forte  { color: #22c55e; }

/* ── Tela de sucesso ──────────────────────────────────────── */
.es-sucesso {
    text-align: center;
    padding: 1rem 0;
}

.es-sucesso-icon {
    font-size: 3.5rem;
    color: #22c55e;
    margin-bottom: 1rem;
    line-height: 1;
}

.es-btn-link {
    display: inline-flex;
    text-decoration: none;
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
}

/* ── Alerta de erro / info ─────────────────────────────────── */
.login-alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.login-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* Responsivo código */
@media (max-width: 400px) {
    .es-digit { width: 38px; height: 46px; font-size: 1.2rem; }
    .es-code-wrap { gap: .35rem; }
    .es-step-connector { width: 28px; }
}
