/* ==========================================================================
   NL Cargo — pantalla de acceso
   --------------------------------------------------------------------------
   Composicion a dos paneles: marca (azul marino) + formulario (blanco).
   Depende de nlcargo-brand.css. Autocontenido: sin Bootstrap ni Tailwind.
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--nl-ink);
    background: var(--nl-surface);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Rejilla principal
   ========================================================================== */

.nl-auth {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    min-height: 100vh;
    min-height: 100svh;
}

/* ==========================================================================
   Panel de marca
   --------------------------------------------------------------------------
   Blanco frio con una caida muy tenue hacia azul. Las dos formas diagonales
   repiten la inclinacion del paralelogramo del logotipo, en tintes del azul
   y del rojo de marca: dan profundidad sin ensuciar el blanco.
   ========================================================================== */

.nl-auth__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: 56px 64px;
    background: linear-gradient(158deg, #FFFFFF 0%, #F4F8FD 52%, #E9F0FA 100%);
    border-right: 1px solid #E5EAF3;
    isolation: isolate;
}

.nl-auth__brand::before,
.nl-auth__brand::after {
    content: "";
    position: absolute;
    z-index: -1;
    transform: skewX(-20deg);
    pointer-events: none;
}

.nl-auth__brand::before {
    top: -18%;
    right: -14%;
    width: 58%;
    height: 136%;
    background: rgba(1, 101, 195, .075);
}

.nl-auth__brand::after {
    top: -18%;
    right: 20%;
    width: 22%;
    height: 136%;
    background: rgba(201, 15, 20, .055);
}

.nl-auth__logo {
    display: block;
    width: 196px;
    max-width: 100%;
    height: auto;
}

.nl-auth__pitch {
    max-width: 30ch;
}

.nl-auth__pitch h1 {
    margin: 0;
    color: var(--nl-support);
    font-size: clamp(28px, 2.6vw, 40px);
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: -.021em;
}

.nl-auth__pitch p {
    margin: 18px 0 0;
    max-width: 38ch;
    color: var(--nl-ink-muted);
    font-size: 15.5px;
    line-height: 1.6;
}

.nl-auth__rule {
    width: 46px;
    height: 3px;
    margin-bottom: 26px;
    background: var(--nl-primary);
}

.nl-auth__meta {
    margin: 0;
    color: #646E7E;
    font-size: 12px;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* ==========================================================================
   Panel de formulario
   ========================================================================== */

.nl-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    background: var(--nl-surface);
}

.nl-auth__form {
    width: 100%;
    max-width: 344px;
}

.nl-auth__eyebrow {
    margin: 0;
    color: var(--nl-primary);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.nl-auth__title {
    margin: 12px 0 6px;
    color: var(--nl-support);
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -.018em;
}

.nl-auth__lead {
    margin: 0 0 34px;
    color: var(--nl-ink-muted);
    font-size: 14.5px;
}

/* --- Campos ------------------------------------------------------------ */

.nl-field + .nl-field { margin-top: 20px; }

.nl-field__label {
    display: block;
    margin-bottom: 8px;
    color: #4A5160;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .005em;
}

.nl-field__input {
    width: 100%;
    padding: 12px 14px;
    color: var(--nl-ink);
    background: var(--nl-surface);
    border: 1px solid var(--nl-line);
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.nl-field__input::placeholder { color: #A2A9B4; }

.nl-field__input:hover { border-color: #C2C8D3; }

.nl-field__input:focus {
    outline: none;
    border-color: var(--nl-primary);
    box-shadow: 0 0 0 3px rgba(201, 15, 20, .13);
}

.nl-field__input:-webkit-autofill {
    -webkit-text-fill-color: var(--nl-ink);
    -webkit-box-shadow: 0 0 0 40px #FFFFFF inset;
}

/* --- Boton primario ---------------------------------------------------- */

.nl-btn {
    display: block;
    width: 100%;
    margin-top: 30px;
    padding: 13px 18px;
    color: var(--nl-on-primary);
    background: var(--nl-primary);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .012em;
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease;
}

.nl-btn:hover { background: var(--nl-primary-hover); }

.nl-btn:active { background: var(--nl-primary-active); }

.nl-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 15, 20, .3);
}

/* --- Error de autenticacion --------------------------------------------
   Carmin oscuro sobre fondo tintado y filete lateral: se distingue del
   boton rojo de accion sin gritar.                                        */

.nl-alert {
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 6px;
    border-left: 3px solid var(--nl-danger);
    background: var(--nl-danger-bg);
    color: var(--nl-danger);
    font-size: 13.5px;
    line-height: 1.5;
}

/* --- Pie del panel ------------------------------------------------------ */

.nl-auth__footnote {
    margin: 40px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--nl-line);
    color: #6E7684;
    font-size: 12.5px;
}

/* ==========================================================================
   Adaptacion a pantallas pequenas
   ========================================================================== */

@media (max-width: 960px) {
    .nl-auth {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .nl-auth__brand {
        gap: 28px;
        padding: 36px 32px 40px;
        border-right: 0;
        border-bottom: 1px solid #E5EAF3;
    }

    .nl-auth__brand::before { width: 72%; right: -22%; }
    .nl-auth__brand::after  { width: 26%; right: 26%; }

    .nl-auth__logo { width: 158px; }

    .nl-auth__pitch { max-width: none; }

    .nl-auth__pitch h1 { font-size: 26px; }

    .nl-auth__pitch p { display: none; }

    .nl-auth__rule { margin-bottom: 20px; }

    .nl-auth__meta { display: none; }

    .nl-auth__panel { padding: 44px 32px 56px; }
}

@media (max-width: 420px) {
    .nl-auth__brand { padding: 28px 22px 32px; }
    .nl-auth__logo  { width: 136px; }
    .nl-auth__pitch h1 { font-size: 22px; }
    .nl-auth__panel { padding: 36px 22px 44px; }
    .nl-auth__title { font-size: 24px; }
}

/* ==========================================================================
   Preferencias del sistema
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .nl-field__input,
    .nl-btn { transition: none; }
}
