/* =========================================================
   COL-TEK - Login corporativo
   Paleta: navy #13235B, cyan #0099DE, azul de marca #0a6fe0
   ========================================================= */

:root {
    --navy: #13235b;
    --deep: #041640;
    --blue: #0a6fe0;
    --blue-2: #1591f0;
    --cyan: #0099de;
    --ink: #0f1f45;
    --muted: #6b7690;
    --line: #dfe6f1;
    --page: #f3f7fd;
    --danger: #c83349;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a, input { outline: none; }
a { color: inherit; }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(480px, 1.13fr) minmax(460px, 1fr);
}

/* =========================
   PANEL DE MARCA
   ========================= */

.brand-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(40px, 7vh, 88px) clamp(40px, 5.5vw, 92px) 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(ellipse at 88% 45%, rgba(24, 120, 255, 0.34), transparent 55%),
        radial-gradient(ellipse at 10% 0%, rgba(20, 90, 200, 0.28), transparent 48%),
        linear-gradient(160deg, #03113a 0%, #052064 52%, #06307f 100%);
}

/* Globo de puntos (dibujado en canvas por login-corporativo.js) */
.brand-globe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    width: min(680px, 100%);
}

.brand-logo {
    display: block;
    width: clamp(240px, 19vw, 320px);
    height: auto;
}

.brand-copy {
    margin-top: clamp(40px, 8vh, 92px);
}

.eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    font-weight: 700;
    color: #2e8dff;
}

.brand-copy h1 {
    margin: 22px 0 22px;
    font-size: clamp(2.3rem, 3.55vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.brand-copy h1 span {
    display: block;
    color: #1f8bff;
}

.brand-copy p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    line-height: 1.65;
}

.brand-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: clamp(28px, 5vh, 52px);
    max-width: 660px;
}

.brand-benefit {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px 18px;
    border: 1px solid rgba(90, 160, 255, 0.28);
    border-radius: 10px;
    background: rgba(8, 40, 110, 0.55);
    backdrop-filter: blur(6px);
}

.brand-benefit strong,
.brand-benefit span { display: block; }

.brand-benefit strong {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.brand-benefit > div > span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

.brand-benefit .benefit-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(20, 100, 220, 0.55);
}

.benefit-icon svg,
.input-icon svg,
.password-toggle svg,
.button-arrow svg,
.support-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-footer {
    position: relative;
    z-index: 2;
    margin-top: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.brand-words {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.7);
}

.brand-words::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 34px;
    height: 3px;
    border-radius: 2px;
    background: #1f8bff;
}

.brand-words i { font-style: normal; opacity: .7; }

.brand-script {
    font-family: 'Caveat', 'Segoe Script', cursive;
    font-size: 1.85rem;
    line-height: 1.02;
    color: #fff;
    transform: rotate(-6deg);
    text-align: left;
    padding-right: 6px;
}

.brand-script::after {
    content: "";
    display: block;
    width: 130px;
    height: 2px;
    margin: 4px 0 0 40px;
    background: #4ea3ff;
    border-radius: 2px;
    transform: rotate(-3deg);
}

/* =========================
   PANEL DE ACCESO
   ========================= */

.access-panel {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 70px);
    background:
        radial-gradient(circle at 96% 4%, rgba(0, 120, 230, 0.09), transparent 24%),
        radial-gradient(circle at 100% 100%, rgba(0, 120, 230, 0.09), transparent 26%),
        var(--page);
}

.access-corner {
    position: absolute;
    right: 28px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.6rem;
    line-height: 1.85;
    color: #5d6b88;
    max-width: 160px;
}

.access-corner::after {
    content: "";
    display: block;
    width: 32px;
    height: 3px;
    border-radius: 2px;
    margin-top: 8px;
    background: var(--blue);
}

.access-corner--top { top: 36px; }
.access-corner--bottom { bottom: 32px; }

.access-card {
    position: relative;
    z-index: 1;
    width: min(510px, 100%);
    padding: clamp(28px, 3.4vw, 42px);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(20, 50, 110, 0.10), 0 4px 14px rgba(20, 50, 110, 0.05);
}

.mobile-logo { display: none; }

.access-heading { margin-bottom: 30px; }

.access-kicker {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.access-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.9rem, 2.6vw, 2.5rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
    font-weight: 800;
}

.access-heading p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.5;
}

.alert--error {
    color: #8f2032;
    background: #fff0f3;
    border: 1px solid #ffd3dc;
}

.alert--ok {
    color: #14532d;
    background: #ecfdf3;
    border: 1px solid #b7ebcb;
}

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

.field { display: grid; gap: 6px; }

.field label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.input-wrap { position: relative; }

.input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #f5f8fc;
    font-size: 0.98rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-wrap input::placeholder { color: #8a95ad; }

.input-wrap input:hover { border-color: #c7d3e6; }

.input-wrap input:focus {
    border-color: rgba(10, 111, 224, 0.7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 111, 224, 0.10);
}

.input-wrap input.is-invalid {
    border-color: rgba(200, 51, 73, 0.7);
    box-shadow: 0 0 0 4px rgba(200, 51, 73, 0.08);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    translate: 0 -50%;
    color: #6e7a95;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    translate: 0 -50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #4f5c78;
    background: transparent;
    cursor: pointer;
    transition: .18s ease;
}

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

.eye--closed { display: none; }
.password-toggle.is-visible .eye--open { display: none; }
.password-toggle.is-visible .eye--closed { display: block; }

.field-error {
    min-height: 0;
    color: var(--danger);
    font-size: 0.76rem;
}
.field-error:empty { display: none; }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.remember {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #26334e;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #c3cfe2;
    border-radius: 5px;
    background: #fff;
    transition: .18s ease;
}

.checkmark::after {
    content: "";
    width: 11px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform .16s ease;
}

.remember input:checked + .checkmark {
    border-color: var(--blue);
    background: var(--blue);
}

.remember input:checked + .checkmark::after {
    transform: translateY(-1px) rotate(-45deg) scale(1);
}

.remember input:focus-visible + .checkmark { box-shadow: 0 0 0 4px rgba(10, 111, 224, 0.15); }

.text-link {
    color: var(--blue);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover { text-decoration: underline; }

.submit-btn {
    position: relative;
    height: 58px;
    margin-top: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: linear-gradient(90deg, #0a62d6 0%, #0a7fe6 55%, #12a0f2 100%);
    box-shadow: 0 12px 26px rgba(10, 111, 224, 0.28);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 32px rgba(10, 111, 224, 0.34);
}

.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { cursor: progress; }

.button-label {
    font-size: 1.02rem;
    font-weight: 600;
}

.button-arrow { display: inline-grid; place-items: center; transition: transform .18s ease; }
.submit-btn:hover .button-arrow { transform: translateX(3px); }

.button-loader {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin .75s linear infinite;
}

.submit-btn.is-loading .button-label,
.submit-btn.is-loading .button-arrow { display: none; }
.submit-btn.is-loading .button-loader { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.access-divider {
    margin: 30px 0 22px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}

.access-divider span { height: 1px; background: var(--line); }

.access-divider em {
    color: #6b7690;
    font-size: 0.85rem;
    font-style: normal;
}

.support-note {
    display: flex;
    gap: 22px;
    align-items: center;
    padding: 0 6px 0 18px;
}

.support-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--blue);
    background: #e6f1fd;
}

.support-icon svg { width: 28px; height: 28px; }

.support-note p {
    margin: 0;
    color: #26334e;
    font-size: 0.85rem;
    line-height: 1.5;
}

.support-note a {
    display: inline-block;
    margin-top: 6px;
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.support-note a:hover { text-decoration: underline; }

.access-footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    color: #6b7690;
    font-size: 0.78rem;
    line-height: 1.7;
    text-align: center;
}

.access-footer span { display: block; color: #97a2b8; }

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1080px) {
    .login-shell { grid-template-columns: 1fr 1fr; }
    .brand-panel { padding: 44px 34px 34px; }
    .brand-benefits { grid-template-columns: 1fr; }
    .brand-script { display: none; }
    .access-corner { display: none; }
}

@media (max-width: 860px) {
    .login-shell {
        display: block;
        background:
            radial-gradient(circle at 80% 0, rgba(10, 111, 224, 0.10), transparent 30%),
            var(--page);
    }

    .brand-panel { display: none; }

    .access-panel { min-height: 100vh; padding: 26px 18px; }

    .access-card { padding: 28px 22px; }

    .mobile-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 26px;
    }

    .mobile-logo img { width: min(230px, 70%); height: auto; }
}

@media (max-width: 520px) {
    .access-panel { justify-content: flex-start; padding-top: 18px; }
    .form-options { flex-wrap: wrap; }
    .support-note { padding-left: 0; gap: 14px; }
    .support-icon { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
