/* ============================================================================
   LOGIN V2 - HarpasiosApp3
   Visual minimalista com glassmorphism, fundo animado e emblema giratório.
   Carregado em substituicao a login.css. Para reverter, trocar o link no head.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1a2060;
}
body {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f5ff 35%, #e4eeff 70%, #dce8ff 100%);
    overflow-x: hidden;
}

/* ── Fundo: circuitos SVG suaves ── */
.lv2-bg-circuits {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.40;
}

/* ── Fundo: partículas que sobem ── */
.lv2-particles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.lv2-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(40, 130, 255, 0.55);
    box-shadow: 0 0 6px rgba(40, 130, 255, 0.7);
    animation: lv2FloatUp linear infinite;
}
@keyframes lv2FloatUp {
    0%   { transform: translateY(110vh) scale(0); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 0.55; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Fundo: emblema giratório (usa o próprio logo Harpasios) ── */
.lv2-bg-emblem {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(85vmin, 620px);
    height: min(85vmin, 620px);
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.10;
    border-radius: 50%;
    overflow: hidden;
    animation: lv2BgSpin 90s linear infinite, lv2BgBreath 9s ease-in-out infinite;
}
.lv2-bg-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
@keyframes lv2BgSpin   { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes lv2BgBreath { 0%, 100% { opacity: 0.08; } 50% { opacity: 0.13; } }

/* ── Layout principal ── */
.lv2-layout {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Card de login ── */
.lv2-card {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(20, 60, 180, 0.14),
        0 4px 20px rgba(20, 60, 180, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 32px 32px 28px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lv2CardIn 0.85s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes lv2CardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Logo / emblema central com animações ── */
.lv2-logo-scene {
    position: relative;
    width: 152px;
    height: 152px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lv2-logo-glow {
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 100, 255, 0.20) 0%, transparent 65%);
    animation: lv2GlowBreath 4.5s ease-in-out infinite;
}
@keyframes lv2GlowBreath {
    0%, 100% { transform: scale(0.88); opacity: 0.5; }
    50%      { transform: scale(1.10); opacity: 1; }
}
.lv2-logo-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(40, 140, 255, 0.4);
    animation: lv2PulseOut 3s ease-out infinite;
    pointer-events: none;
}
.lv2-logo-pulse.delay-1 { animation-delay: 1s;  border-color: rgba(40, 140, 255, 0.25); }
.lv2-logo-pulse.delay-2 { animation-delay: 2s;  border-color: rgba(40, 140, 255, 0.15); }
@keyframes lv2PulseOut {
    0%   { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.55); opacity: 0;   }
}
.lv2-logo-img {
    position: relative;
    z-index: 5;
    width: 144px;
    height: 144px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.6);
    padding: 4px;
    display: block;
    animation: lv2LogoBreath 5.5s ease-in-out infinite;
    box-shadow:
        0 6px 22px rgba(20, 80, 200, 0.30),
        0 0 16px rgba(40, 130, 255, 0.22);
}
@keyframes lv2LogoBreath {
    0%, 100% { transform: scale(1.00); filter: brightness(1.00) saturate(1.05); }
    50%      { transform: scale(1.04); filter: brightness(1.08) saturate(1.18); }
}

/* ── Tipografia do título ── */
.lv2-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d1f6e;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
    text-align: center;
}
.lv2-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.38em;
    color: #6080c0;
    text-transform: uppercase;
    margin-bottom: 24px;
    text-align: center;
}

/* ── Badge de ambiente (DEV/STAGING) ── */
.lv2-env-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

/* ── Form ── */
.lv2-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lv2-field {
    position: relative;
    width: 100%;
}
.lv2-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8090b8;
    font-size: 0.95rem;
    pointer-events: none;
}
.lv2-field input {
    width: 100%;
    padding: 13px 44px 13px 42px;
    border: 1.5px solid #d0d8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #1a2060;
    background: #f8faff;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.lv2-field input::placeholder { color: #a0b0d0; }
.lv2-field input:focus {
    border-color: #1a4ed8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 78, 216, 0.12);
}
.lv2-field input.field-error {
    border-color: #ef4444;
    background: #fef2f2;
}
.lv2-eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #8090b8;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
}
.lv2-eye-btn:hover { color: #1a4ed8; }

/* ── Lembrar-me ── */
.lv2-remember {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f4f7ff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 2px;
    cursor: pointer;
}
.lv2-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #1a4ed8;
    cursor: pointer;
    flex-shrink: 0;
}
.lv2-remember-content { display: flex; flex-direction: column; }
.lv2-remember-text {
    font-size: 0.85rem;
    color: #4050a0;
    font-weight: 600;
    line-height: 1.35;
}
.lv2-remember-sub {
    font-size: 0.74rem;
    color: #8090b8;
    margin-top: 2px;
    font-weight: 400;
    line-height: 1.4;
}

/* ── Botão Entrar ── */
.lv2-btn-enter {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
    background: linear-gradient(135deg, #1a3fa8 0%, #1a4ed8 50%, #1a3fa8 100%);
    background-size: 200% 100%;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(26, 63, 168, 0.35);
    transition: transform 0.25s, box-shadow 0.25s;
    animation: lv2BtnShimmer 4s ease infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}
@keyframes lv2BtnShimmer {
    0%, 100% { background-position: 0%   50%; }
    50%      { background-position: 100% 50%; }
}
.lv2-btn-enter:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 63, 168, 0.45);
}
.lv2-btn-enter:active { transform: translateY(0); }

/* ── Divider e seção de suporte ── */
.lv2-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d0d8f0, transparent);
    margin: 22px 0 14px;
}
.lv2-support-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.45em;
    color: #a0b0d0;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
}
.lv2-support-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.lv2-support-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a4ed8;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}
.lv2-support-link:hover { color: #0d2060; }
.lv2-support-link i { width: 20px; text-align: center; font-size: 0.95rem; }

/* ── Alertas e toasts ── */
.lv2-alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #991b1b;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: lv2AlertIn 0.3s ease-out;
}
.lv2-alert .alert-text { flex: 1; }
.lv2-alert .alert-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: #991b1b;
    font-size: 0.9rem;
    opacity: 0.7;
    padding: 2px 4px;
}
.lv2-alert .alert-dismiss:hover { opacity: 1; }
@keyframes lv2AlertIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.lv2-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #1a2060;
    font-weight: 500;
    animation: lv2ToastIn 0.4s cubic-bezier(.16, 1, .3, 1);
}
.lv2-toast.toast-out { animation: lv2ToastOut 0.35s ease-in forwards; }
.lv2-toast .toast-icon { color: #f59e0b; font-size: 1.1rem; }
.lv2-toast button {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px 4px;
    font-size: 0.95rem;
}
@keyframes lv2ToastIn  { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes lv2ToastOut { to   { opacity: 0; transform: translateX(-50%) translateY(-12px); } }

/* ── Rodapé do card (cookies + reCAPTCHA terms) ── */
.lv2-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(208, 216, 240, 0.7);
    width: 100%;
    text-align: center;
}
.lv2-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}
.lv2-footer-link {
    font-size: 0.7rem;
    color: #8090b8;
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.lv2-footer-link:hover { color: #1a4ed8; text-decoration: underline; }
.lv2-recaptcha-terms {
    font-size: 0.62rem;
    color: #a0b0d0;
    line-height: 1.5;
    padding: 0 4px;
}
.lv2-recaptcha-terms a {
    color: #6080c0;
    text-decoration: none;
    font-weight: 600;
}
.lv2-recaptcha-terms a:hover { text-decoration: underline; }

/* ── Painel debug (mantido como está, gated por app.debug) ── */
.lv2-debug-panel {
    width: 100%;
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 10px;
    overflow: hidden;
}
.lv2-debug-panel summary {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}
.lv2-debug-panel summary::-webkit-details-marker { display: none; }
.lv2-debug-panel[open] summary { border-bottom: 1px dashed rgba(15, 23, 42, 0.15); }
.lv2-debug-grid {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 4px 12px;
    font-size: 0.72rem;
}
.lv2-debug-grid dt { color: #94a3b8; font-weight: 700; }
.lv2-debug-grid dd { color: #475569; font-family: 'Courier New', monospace; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .lv2-card { padding: 24px 22px 22px; max-width: 100%; }
    .lv2-logo-scene { width: 124px; height: 124px; }
    .lv2-logo-img { width: 116px; height: 116px; }
    .lv2-title { font-size: 1.3rem; }
    .lv2-subtitle { font-size: 0.62rem; letter-spacing: 0.32em; }
    .lv2-bg-emblem { opacity: 0.07; }
}

/* ── Reduce-motion: desliga animações pesadas ── */
@media (prefers-reduced-motion: reduce) {
    .lv2-particle,
    .lv2-bg-emblem,
    .lv2-logo-glow,
    .lv2-logo-pulse,
    .lv2-logo-img,
    .lv2-btn-enter { animation: none !important; }
    .lv2-card { animation: none !important; }
}
