/* ============================================================
   Login ARGOS — nova identidade
   Desktop (>=1001px): tela dividida (form à esquerda, marca à direita)
   <=1000px: card centralizado
   Tema light/dark via CSS vars, integrado ao argos-theme global
   ============================================================ */

:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --fg: #0f172a;
    --muted: #64748b;
    --border: #e6ebf3;
    --input-bg: #f6f8fb;
    --input-border: #dbe3ee;
    --primary: #2563eb;
    --primary-d: #1d4ed8;
    --color-primary: #2563eb; /* usado pelo botão do swal-modern (Oops/erro de login) */
    --ring: rgba(37, 99, 235, .5);
    --focus: rgba(37, 99, 235, .16);
    --panel-1: #0b1e46;
    --panel-2: #123a86;
    --panel-fg: #eaf1ff;
    --panel-muted: #9fb4dd;
    --shadow: 0 24px 60px -24px rgba(15, 23, 42, .28);
}

html.dark,
html[data-theme="dark"] {
    --bg: #070d1a;
    --surface: #0f1a30;
    --fg: #e8eefb;
    --muted: #8ea2c4;
    --border: #1e2c48;
    --input-bg: #0b1526;
    --input-border: #25355a;
    --primary: #3b82f6;
    --primary-d: #2f6fe0;
    --color-primary: #3b82f6; /* usado pelo botão do swal-modern (Oops/erro de login) */
    --ring: rgba(59, 130, 246, .5);
    --focus: rgba(59, 130, 246, .22);
    --panel-1: #050b18;
    --panel-2: #0d2657;
    --panel-fg: #eaf1ff;
    --panel-muted: #9fb4dd;
    --shadow: 0 30px 70px -28px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color .3s;
}

/* ---------------- container (tela dividida) ---------------- */
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    min-height: 640px;
    display: flex;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ---------------- painel do formulário ---------------- */
.login-form-panel {
    flex: 0 0 52%;
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.login-theme-toggle {
    position: absolute;
    top: 34px;
    right: 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.login-theme-toggle .ico-moon { display: none; }
html.dark .login-theme-toggle .ico-sun { display: none; }
html.dark .login-theme-toggle .ico-moon { display: inline-flex; }

/* marca */
.login-brandmark { display: flex; align-items: center; padding: 20px 0; }
.brand-logo { height: 90px; width: auto; display: block; }

.login-heading { margin-top: 0px; }
.login-heading h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--fg);
}
.login-heading p {
    margin: 10px 0 0;
    font-size: 15px;
    color: var(--muted);
}

.login-fields {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-field { display: flex; flex-direction: column; gap: 8px; }
.login-field .lbl {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
/* Linha do label da senha: "Senha" à esquerda, "Esqueci minha senha" à direita.
   No mobile o .lbl some (regra abaixo), então o link é ancorado à direita via margin. */
.login-field-lblrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.login-field-lblrow .login-link { margin-left: auto; }

.login-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 16px;
    border-radius: 13px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    transition: border-color .15s, box-shadow .15s;
}
.login-input-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus);
}
.login-input-row input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 15px;
    color: var(--fg);
    outline: none;
    font-family: inherit;
}
.login-input-row input::placeholder { color: var(--muted); opacity: .7; }
.login-input-row input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--fg) !important;
    caret-color: var(--fg);
}

.login-eye {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    padding: 2px;
}
.login-eye .eye-off { display: none; }
.login-eye.is-visible .eye-open { display: none; }
.login-eye.is-visible .eye-off { display: inline-flex; }

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}
.login-keep {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
}
.login-keep input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    cursor: pointer;
    margin: 0;
    position: relative;
    transition: background-color .15s ease, border-color .15s ease;
}
.login-keep input:hover { border-color: var(--primary); }
.login-keep input:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.login-keep input:checked::after {
    content: "";
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.login-keep input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus);
}
.login-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.login-link:hover { text-decoration: underline; }

.login-submit {
    margin-top: 12px;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px var(--ring);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: background .15s, opacity .15s;
}
.login-submit:hover { background: var(--primary-d); }
.login-submit:disabled { opacity: .7; cursor: default; }

.login-spinner { animation: loginSpin .8s linear infinite; }
@keyframes loginSpin { to { transform: rotate(360deg); } }

.login-foot {
    margin-top: auto;
    padding-top: 26px;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------------- painel da marca (desktop) ---------------- */
.login-brand-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, var(--panel-1), var(--panel-2));
    color: var(--panel-fg);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-brand-panel .glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 22%, rgba(90, 157, 255, .4), transparent 55%),
        radial-gradient(circle at 12% 92%, rgba(37, 99, 235, .35), transparent 50%);
}
.login-brand-panel .grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 60% 40%, #000, transparent 78%);
    mask-image: radial-gradient(circle at 60% 40%, #000, transparent 78%);
}
.login-brand-content { position: relative; }
.login-brand-content h2 {
    margin: 38px 0 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    max-width: 380px;
}
.login-brand-content p {
    margin: 16px 0 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--panel-muted);
    max-width: 360px;
}

.login-radar { position: relative; width: 150px; height: 150px; color: #8fbaff; }
.login-radar svg { position: absolute; inset: 0; }
.login-radar .sweep { transform-origin: 50% 50%; animation: argosSweep 6s linear infinite; }
.login-radar .radar-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 88px;
    transform: translate(-50%, -50%);
    object-fit: contain;
}
@keyframes argosSweep { to { transform: rotate(360deg); } }

/* ---------------- <= 1000px: card centralizado ---------------- */
@media (max-width: 1000px) {
    .login-shell {
        max-width: 460px;
        min-height: 0;
    }
    .login-brand-panel { display: none; }

    .login-form-panel {
        flex: 1 1 auto;
        padding: 44px 40px 38px;
        align-items: center;
        text-align: center;
    }
    .login-theme-toggle { top: 24px; right: 24px; }

    .login-brandmark .brand-logo { height: 62px; }

    .login-heading { margin-top: 20px; }
    .login-heading h1 { font-size: 22px; }

    .login-fields { width: 100%; margin-top: 26px; gap: 15px; }
    .login-field .lbl { display: none; }
    .login-foot { text-align: center; margin-top: 22px; padding-top: 22px; }
}
