/* === FONTS === */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* === TOKENS === */
:root {
    --ink-900: #0B1220;
    --ink-800: #0F1B2D;
    --ink-700: #152439;
    --slate-600: #475569;
    --slate-500: #64748B;
    --slate-400: #94A3B8;
    --slate-300: #CBD5E1;
    --slate-200: #E2E8F0;
    --slate-100: #F1F5F9;
    --slate-50:  #F8FAFC;
    --emerald-800: #065F46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10B981;
    --danger-600: #DC2626;
    --sans: "IBM Plex Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* === RESET === */
.login-body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
    background: #F6F8FB;
}
.login-body *, .login-body *::before, .login-body *::after { box-sizing: border-box; }

/* === GRID === */
.app { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 960px) {
    .app { grid-template-columns: 1fr !important; }
    .brand-panel { display: none !important; }
    .form-panel { min-height: 100vh; grid-column: 1; }
}

/* === LEFT — brand === */
.brand-panel {
    position: relative;
    background: radial-gradient(1200px 700px at 15% 20%, #152439 0%, #0B1220 65%);
    color: #fff;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.brand-panel::before {
    content: ""; position: absolute;
    width: 720px; height: 720px;
    left: -180px; bottom: -260px;
    background: radial-gradient(closest-side, rgba(16,185,129,0.18), rgba(16,185,129,0) 70%);
    filter: blur(20px);
    pointer-events: none;
}
.brand-panel::after {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(1200px 700px at 80% 60%, #000 0%, transparent 75%);
            mask-image: radial-gradient(1200px 700px at 80% 60%, #000 0%, transparent 75%);
    pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }

.brand-top { display: flex; align-items: center; }
.brand-logo { height: 48px; width: auto; display: block; }

.brand-mid h1 {
    font-size: clamp(40px, 4.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 500;
    margin: 0;
    max-width: 540px;
}
.brand-mid h1 em {
    font-style: normal;
    color: var(--emerald-500);
}
.brand-mid p {
    font-size: 18px;
    line-height: 1.55;
    color: var(--slate-300);
    max-width: 460px;
    margin: 28px 0 0;
}

.brand-bottom {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--slate-400);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.status-pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(16,185,129,0.10);
    border: 1px solid rgba(16,185,129,0.2);
    color: var(--emerald-500);
    font-size: 12px;
    letter-spacing: 0.08em;
}
.status-pill .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--emerald-500);
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* === RIGHT — form === */
.form-panel {
    background: #fff;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}
@media (max-width: 600px) { .form-panel { padding: 40px 28px; } }

.form-top {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    font-size: 14px;
    color: var(--slate-500);
}
.form-top a { color: var(--emerald-700); font-weight: 500; text-decoration: none; }
.form-top a:hover { color: var(--emerald-800); text-decoration: underline; }

.form-wrap { width: 100%; max-width: 420px; margin: 0 auto; }

.form-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--emerald-700);
    margin-bottom: 14px;
    font-weight: 500;
}
.form-title {
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 600;
    margin: 0;
}
.form-sub {
    color: var(--slate-500);
    font-size: 16px;
    margin: 12px 0 36px;
    line-height: 1.5;
}

/* === Campos === */
.field { margin-bottom: 18px; }
.field .ui-outputlabel,
.field > label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--slate-500);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .ic {
    position: absolute;
    left: 16px;
    color: var(--slate-400);
    pointer-events: none;
    display: flex;
    z-index: 1;
}

/* PrimeFaces inputs */
.input-wrap .ui-inputtext,
.input-wrap .ui-password input.input,
.input-wrap input.input {
    width: 100% !important;
    height: 48px;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    background: #fff;
    padding: 0 16px 0 46px;
    font-size: 15px;
    font-family: var(--sans);
    color: var(--ink-900);
    transition: border-color .12s, box-shadow .12s;
}
.input-wrap .ui-inputtext::placeholder { color: var(--slate-400); }
.input-wrap .ui-inputtext:focus,
.input-wrap .ui-password input:focus {
    outline: none;
    border-color: var(--emerald-600);
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}
.input-wrap .ui-inputtext.ui-state-error,
.input-wrap .ui-password input.ui-state-error {
    border-color: var(--danger-600);
    box-shadow: 0 0 0 4px rgba(220,38,38,0.12);
}

/* p:password container + toggleMask icon */
.input-wrap .ui-password { width: 100%; display: flex; align-items: center; position: relative; }
.input-wrap .ui-password-toggle-mask-icon,
.input-wrap .ui-password .pi-eye,
.input-wrap .ui-password .pi-eye-slash {
    position: absolute;
    right: 16px;
    color: var(--slate-500);
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
}
.input-wrap .ui-password-toggle-mask-icon:hover { color: var(--ink-800); }

/* === Checkbox + link === */
.row-options {
    display: flex; align-items: center; justify-content: space-between;
    margin: 6px 0 28px;
}
.checkbox {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 14px;
    color: var(--slate-600);
    cursor: pointer;
    user-select: none;
}
.checkbox .ui-chkbox-box {
    width: 18px; height: 18px;
    border: 1px solid var(--slate-300);
    border-radius: 5px;
    background: #fff;
    transition: all .12s ease;
}
.checkbox .ui-chkbox-box.ui-state-active {
    background: var(--emerald-700);
    border-color: var(--emerald-700);
}
.checkbox .ui-chkbox-box .ui-chkbox-icon { color: #fff; }

.link-soft {
    font-size: 14px;
    color: var(--emerald-700);
    text-decoration: none;
    font-weight: 500;
}
.link-soft:hover { color: var(--emerald-800); text-decoration: underline; }

/* === Botão primário === */
.btn-primary,
.ui-button.btn-primary {
    width: 100% !important;
    height: 52px;
    background: var(--emerald-700) !important;
    color: #fff !important;
    border: 1px solid var(--emerald-700) !important;
    border-radius: 10px !important;
    font-family: var(--sans) !important;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset,
                0 8px 20px rgba(4,120,87,0.28);
    transition: all .15s ease;
}
.btn-primary:hover,
.ui-button.btn-primary:hover {
    background: var(--emerald-800) !important;
    border-color: var(--emerald-800) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset,
                0 12px 26px rgba(4,120,87,0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary .ui-icon { color: #fff; }
.btn-primary.btn-loading,
.ui-button.btn-primary.btn-loading {
    opacity: 0.75 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: var(--emerald-800) !important;
}

/* === Mensagens === */
.login-messages { margin-bottom: 18px; }
.login-messages .ui-messages-error {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
}

/* === Footer === */
.form-bottom {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--slate-400);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
