/* login.css — tela de login do Nexus Admin (não depende do Bootstrap) */

:root {
    --brand-900: #0b1f4d;
    --brand-700: #1d4ed8;
    --brand-600: #2563eb;
    --brand-500: #3b82f6;
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --line: #e2e8f0;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --page: #f1f5f9;
    --danger-600: #dc2626;
    --danger-50: #fef2f2;
    --danger-200: #fecaca;
    --warn-700: #b45309;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.login-page {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink-900);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

.material-icons-round {
    font-family: 'Material Icons Round';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, 46%) 1fr;
}

/* ---------- Painel da marca ---------- */
.brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(900px 500px at 110% -10%, rgba(59, 130, 246, 0.55), transparent 60%),
        radial-gradient(700px 500px at -20% 120%, rgba(37, 99, 235, 0.6), transparent 60%),
        linear-gradient(160deg, var(--brand-900) 0%, #12307a 55%, var(--brand-700) 100%);
}

/* grade sutil de fundo */
.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 85%);
    pointer-events: none;
}

.brand-panel > * { position: relative; }

.brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.2px;
}

.brand-copy { max-width: 460px; }

.brand-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.brand-copy p {
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    line-height: 1.55;
}

.brand-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.brand-features .material-icons-round {
    font-size: 18px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-footer {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ---------- Painel do formulário ---------- */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--surface);
}

.form-wrap {
    width: 100%;
    max-width: 400px;
}

.mobile-brand { display: none; }

.form-header h2 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.form-header p {
    margin: 0 0 28px;
    color: var(--ink-500);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---------- Alerta de erro ---------- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: var(--danger-50);
    border: 1px solid var(--danger-200);
    color: var(--danger-600);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.45;
    animation: shake 0.35s ease;
}

.login-alert[hidden] { display: none; }
.login-alert .material-icons-round { font-size: 20px; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---------- Campos ---------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-700);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 20px;
    color: var(--ink-400);
    pointer-events: none;
    transition: color 0.15s;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 46px 0 44px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink-900);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.input-wrap input::placeholder { color: var(--ink-400); }

.input-wrap input:hover { border-color: #cbd5e1; }

.input-wrap input:focus {
    background: var(--surface);
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.input-wrap:focus-within .input-icon { color: var(--brand-600); }

.input-wrap input.invalid {
    border-color: var(--danger-600);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.toggle-pass {
    position: absolute;
    right: 6px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-400);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.toggle-pass:hover { background: #eef2f7; color: var(--ink-700); }
.toggle-pass:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.toggle-pass .material-icons-round { font-size: 20px; }

.caps-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--warn-700);
}

.caps-warning[hidden] { display: none; }
.caps-warning .material-icons-round { font-size: 16px; }

/* ---------- Linha lembrar / esqueci ---------- */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 24px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ink-500);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--brand-600);
    cursor: pointer;
}

.link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
    border-radius: 4px;
}

.link:hover { color: var(--brand-700); text-decoration: underline; }
.link:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ---------- Botão ---------- */
.btn-login {
    position: relative;
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-600) 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 8px 20px -8px rgba(37, 99, 235, 0.6);
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}

.btn-login:hover { filter: brightness(1.05); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 10px 24px -8px rgba(37, 99, 235, 0.7); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.btn-login:disabled { cursor: progress; filter: saturate(0.85); }

.btn-arrow { font-size: 20px; transition: transform 0.15s; }
.btn-login:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading .btn-spinner { display: inline-block; }
.btn-login.loading .btn-arrow { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nota de segurança ---------- */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: var(--ink-400);
    text-align: center;
}

.security-note .material-icons-round { font-size: 15px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .brand-panel { display: none; }

    .form-panel {
        align-items: flex-start;
        padding: 0;
        background: var(--page);
    }

    .form-wrap {
        max-width: 440px;
        margin: 0 auto;
        padding: 0 16px 32px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 -16px 28px;
        padding: 18px 20px;
        color: #fff;
        font-weight: 700;
        background: linear-gradient(135deg, var(--brand-900), var(--brand-600));
    }

    .mobile-logo img { width: 30px; height: 30px; object-fit: contain; display: block; }

    .form-header, #loginAlert, #loginForm, .security-note {
        background: transparent;
    }

    #loginForm {
        background: var(--surface);
        padding: 22px 20px;
        border-radius: 14px;
        border: 1px solid var(--line);
        box-shadow: 0 6px 20px -12px rgba(15, 23, 42, 0.25);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
