:root {
    --coelnicsa-blue: #0a086b;
    --coelnicsa-blue-2: #17157d;
    --coelnicsa-blue-soft: #2a2a91;
    --coelnicsa-yellow: #f0dc00;
    --coelnicsa-yellow-dark: #d5be00;

    --login-bg: #f3f4f7;
    --login-surface: #ffffff;
    --login-text: #1b2130;
    --login-muted: #697386;
    --login-border: #dfe3ea;
    --login-danger: #c93645;
    --login-shadow: 0 26px 60px rgba(19, 24, 45, .12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--login-text);
    background: var(--login-bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(470px, .93fr) minmax(500px, 1.07fr);
}

/* =========================================================
   Identidad corporativa
========================================================= */

.login-identity {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(38px, 5vw, 72px);
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255,255,255,.035), transparent 36%),
        linear-gradient(150deg, var(--coelnicsa-blue-2) 0%, var(--coelnicsa-blue) 56%, #07074e 100%);
}

.login-identity::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .08;
    background-image:
        linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(135deg, #000 20%, transparent 86%);
}

.login-identity::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--coelnicsa-yellow);
}

.login-identity__shape {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.login-identity__shape--one {
    width: 360px;
    height: 360px;
    right: -150px;
    top: 12%;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255,255,255,.018),
        0 0 0 112px rgba(255,255,255,.012);
}

.login-identity__shape--two {
    width: 210px;
    height: 210px;
    left: -78px;
    bottom: 15%;
    transform: rotate(28deg);
    border: 22px solid rgba(240,220,0,.055);
    border-radius: 44px;
}

.login-identity__content {
    position: relative;
    z-index: 2;
    width: min(610px, 100%);
    margin-block: auto;
}

.login-logo-box {
    width: min(330px, 88%);
    margin-bottom: clamp(58px, 9vh, 94px);
    padding: 16px 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(0,0,0,.16);
}

.login-logo-box img {
    display: block;
    width: 100%;
    height: auto;
}

.login-identity__eyebrow,
.login-card__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.login-identity__eyebrow {
    margin-bottom: 18px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
}

.login-identity__text h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.25rem, 4.1vw, 4.1rem);
    line-height: 1.03;
    letter-spacing: -.045em;
}

.login-identity__text h1 span {
    display: block;
    margin-top: 7px;
    color: var(--coelnicsa-yellow);
}

.login-identity__text p {
    max-width: 520px;
    margin: 22px 0 0;
    color: rgba(255,255,255,.72);
    font-size: 1rem;
    line-height: 1.7;
}

.login-system-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

.login-system-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 12px;
    color: rgba(255,255,255,.84);
    background: rgba(255,255,255,.07);
    font-size: .82rem;
    font-weight: 700;
}

.login-system-pill i {
    color: var(--coelnicsa-yellow);
}

.login-identity__footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.5);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.login-identity__footer i {
    color: var(--coelnicsa-yellow);
    opacity: .9;
}

/* =========================================================
   Formulario
========================================================= */

.login-form-panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(30px, 6vw, 82px);
    background:
        radial-gradient(circle at 88% 12%, rgba(10,8,107,.055), transparent 24%),
        linear-gradient(180deg, #f8f9fb 0%, var(--login-bg) 100%);
}

.login-form-panel::after {
    content: "";
    position: absolute;
    right: clamp(28px, 5vw, 70px);
    bottom: clamp(28px, 5vw, 70px);
    width: 72px;
    height: 6px;
    border-radius: 999px;
    background: var(--coelnicsa-yellow);
    opacity: .85;
}

.login-card {
    position: relative;
    width: min(455px, 100%);
    padding: clamp(30px, 4vw, 42px);
    border: 1px solid rgba(213,218,227,.9);
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--login-shadow);
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 34px;
    width: 68px;
    height: 4px;
    border-radius: 0 0 5px 5px;
    background: var(--coelnicsa-yellow);
}

.login-mobile-brand {
    display: none;
    margin-bottom: 34px;
}

.login-mobile-brand__logo {
    width: min(220px, 70vw);
    padding: 10px 12px;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    background: #fff;
}

.login-mobile-brand__logo img {
    display: block;
    width: 100%;
}

.login-mobile-brand > span {
    margin-top: 10px;
    color: var(--login-muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-card__header {
    margin-bottom: 28px;
}

.login-card__eyebrow {
    margin-bottom: 13px;
    color: var(--coelnicsa-blue);
    background: rgba(10,8,107,.075);
}

.login-card__header h2 {
    margin: 0;
    color: var(--login-text);
    font-size: clamp(1.85rem, 3.5vw, 2.35rem);
    line-height: 1.13;
    letter-spacing: -.035em;
}

.login-card__header p {
    margin: 10px 0 0;
    color: var(--login-muted);
    font-size: .92rem;
    line-height: 1.6;
}

.login-alert {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid #f0c9ce;
    border-radius: 13px;
    color: #932d39;
    background: #fff6f7;
}

.login-alert__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--login-danger);
}

.login-alert strong,
.login-alert span {
    display: block;
}

.login-alert strong {
    margin-bottom: 3px;
    font-size: .88rem;
}

.login-alert span {
    font-size: .8rem;
    line-height: 1.42;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field label {
    display: inline-block;
    margin-bottom: 8px;
    color: #353c4a;
    font-size: .82rem;
    font-weight: 700;
}

.login-input {
    position: relative;
}

.login-input > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    color: #8992a3;
    font-size: .95rem;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color .18s ease;
}

.login-input input {
    width: 100%;
    height: 51px;
    padding: 0 48px 0 44px;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: 0;
    color: var(--login-text);
    background: #fff;
    font-size: .91rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-input input::placeholder {
    color: #a2a9b6;
}

.login-input:focus-within > i {
    color: var(--coelnicsa-blue);
}

.login-input input:focus {
    border-color: rgba(10,8,107,.7);
    box-shadow: 0 0 0 4px rgba(10,8,107,.08);
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #7f8899;
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.login-password-toggle:hover {
    color: var(--coelnicsa-blue);
    background: #f1f2f6;
}

.login-remember {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--login-muted);
    font-size: .81rem;
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.login-remember__box {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    border: 1px solid #c9ced8;
    border-radius: 5px;
    color: var(--coelnicsa-blue);
    background: #fff;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.login-remember__box i {
    font-size: .65rem;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .15s ease, transform .15s ease;
}

.login-remember input:checked + .login-remember__box {
    border-color: var(--coelnicsa-yellow-dark);
    background: var(--coelnicsa-yellow);
    box-shadow: 0 0 0 3px rgba(240,220,0,.15);
}

.login-remember input:checked + .login-remember__box i {
    opacity: 1;
    transform: scale(1);
}

.login-submit {
    width: 100%;
    height: 52px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--coelnicsa-blue-2), var(--coelnicsa-blue));
    box-shadow: 0 12px 24px rgba(10,8,107,.22);
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.login-submit i {
    color: var(--coelnicsa-yellow);
    transition: transform .18s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(10,8,107,.26);
    filter: brightness(1.03);
}

.login-submit:hover i {
    transform: translateX(3px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-card__footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    color: #9199a8;
}

.login-card__footer > div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: .71rem;
    font-weight: 600;
}

.login-card__footer i {
    color: var(--coelnicsa-blue-soft);
}

.login-card__footer-line {
    height: 1px;
    background: #eceef2;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 980px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-identity {
        display: none;
    }

    .login-form-panel {
        min-height: 100svh;
        padding: 26px 18px;
    }

    .login-form-panel::before {
        content: "";
        position: fixed;
        inset: 0 0 auto 0;
        height: 5px;
        background: var(--coelnicsa-yellow);
    }

    .login-form-panel::after {
        display: none;
    }

    .login-mobile-brand {
        display: grid;
        justify-items: center;
    }
}

@media (max-width: 560px) {
    body {
        background: #fff;
    }

    .login-form-panel {
        place-items: center;
        padding: 24px 16px;
        background: #fff;
    }

    .login-card {
        padding: 20px 4px 8px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .login-card::before {
        display: none;
    }

    .login-mobile-brand {
        margin-bottom: 38px;
    }

    .login-card__header {
        margin-bottom: 26px;
    }

    .login-card__header h2 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
