/* =========================================================
   TRADE FLOW IA - FRONTEND V0.1
   Login / Fundación visual
   ========================================================= */

:root {
    --eh-blue: #005eb8;
    --eh-blue-2: #0b73e0;
    --eh-blue-dark: #073b78;
    --navy: #0b2548;
    --pink: #e5007d;
    --pink-soft: #ff66ae;
    --white: #ffffff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --line: rgba(47, 91, 151, 0.16);
    --text: #0f2342;
    --muted: #63738d;
    --success: #0f9d69;
    --danger: #cf2e2e;
    --shadow: 0 24px 60px rgba(39, 79, 130, 0.16);
    --shadow-soft: 0 14px 32px rgba(57, 96, 151, 0.11);
    --radius-xl: 32px;
    --radius-lg: 22px;
    --radius-md: 15px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #edf6ff;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(249, 252, 255, 0.95) 0%, rgba(249, 252, 255, 0.80) 48%, rgba(237, 247, 255, 0.54) 100%),
        url("../assets/backgrounds/Background.png") center / cover no-repeat fixed;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(430px, 47%) 1fr;
    overflow: hidden;
}

.login-panel {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px clamp(38px, 6vw, 96px);
    background:
        linear-gradient(140deg, rgba(255,255,255,0.96), rgba(249,252,255,0.83));
    border-right: 1px solid rgba(0, 94, 184, 0.08);
    backdrop-filter: blur(10px);
}

.brand {
    position: absolute;
    top: 34px;
    left: clamp(38px, 6vw, 96px);
}

.brand-logo {
    display: block;
    width: 205px;
    height: auto;
}

.brand-kicker {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.login-copy {
    width: min(100%, 510px);
    margin: 42px 0 24px;
}

.prototype-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(0, 94, 184, 0.12);
    border-radius: 999px;
    background: #eef7ff;
    color: var(--eh-blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.login-copy h1 {
    margin: 15px 0 8px;
    font-size: clamp(2rem, 3.3vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    color: var(--navy);
}

.login-copy h1 span {
    color: var(--eh-blue);
}

.login-copy > p {
    max-width: 480px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.login-card {
    width: min(100%, 510px);
    padding: 27px;
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

.card-heading h2 {
    margin: 2px 0 0;
    color: var(--navy);
    font-size: 1.65rem;
    letter-spacing: -0.02em;
}

.eyebrow {
    margin: 0;
    color: var(--eh-blue);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.secure-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 999px;
    background: #edf9f4;
    color: #187a57;
    font-size: 0.76rem;
    font-weight: 700;
}

.secure-chip svg {
    width: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-group {
    margin: 0 0 15px;
}

.field-group label {
    display: block;
    margin: 0 0 8px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 46px;
    border: 1px solid #d9e2ef;
    border-radius: var(--radius-md);
    outline: none;
    background: #fbfdff;
    color: var(--text);
    transition: 0.18s ease;
}

.input-wrap input::placeholder {
    color: #94a0b3;
}

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

.input-wrap input:focus {
    border-color: var(--eh-blue);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 94, 184, 0.10);
}

.input-wrap.has-error input {
    border-color: #e35d5d;
    box-shadow: 0 0 0 4px rgba(207, 46, 46, 0.07);
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 20px;
    transform: translateY(-50%);
    fill: none;
    stroke: #7989a1;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.icon-button {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #718198;
}

.icon-button:hover {
    background: #eef5fc;
    color: var(--eh-blue);
}

.icon-button svg {
    width: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-error {
    display: block;
    min-height: 16px;
    margin: 5px 0 0 3px;
    color: var(--danger);
    font-size: 0.75rem;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 1px 0 18px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.remember input {
    accent-color: var(--eh-blue);
}

.text-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--eh-blue);
    font-size: 0.78rem;
    font-weight: 700;
}

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

.text-link.inline {
    font-size: inherit;
}

.primary-button {
    display: flex;
    width: 100%;
    height: 55px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 22px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(100deg, var(--eh-blue), #1188ed);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 94, 184, 0.22);
    font-size: 0.98rem;
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(0, 94, 184, 0.29);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    cursor: wait;
    opacity: .78;
}

.primary-button svg {
    width: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.primary-button.is-loading .button-spinner {
    display: inline-block;
}

.primary-button.is-loading svg {
    display: none;
}

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

.login-help {
    margin: 17px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
}

.form-message {
    display: none;
    margin: -3px 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.79rem;
    line-height: 1.45;
}

.form-message.is-visible {
    display: block;
}

.form-message.is-success {
    background: #eaf8f2;
    color: #137a56;
}

.form-message.is-error {
    background: #fff0f0;
    color: #b32222;
}

.form-message.is-info {
    background: #eef6ff;
    color: #175f9f;
}

.security-note {
    display: flex;
    width: min(100%, 510px);
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    color: #76869d;
    font-size: 0.75rem;
}

.security-note svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

/* Visual / LOGI */
.visual-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: 60px clamp(42px, 6vw, 95px);
    overflow: hidden;
}

.visual-glow {
    position: absolute;
    top: 13%;
    right: 4%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76,159,242,.28), rgba(76,159,242,0) 65%);
    filter: blur(4px);
}

.logi-copy {
    position: relative;
    z-index: 2;
    max-width: 610px;
    margin: 0 0 28px auto;
    text-align: right;
}

.logi-tag {
    display: inline-block;
    margin-bottom: 11px;
    color: var(--pink);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.logi-copy h2 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: clamp(2rem, 3.1vw, 3.55rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.logi-copy h2 span {
    color: var(--eh-blue);
}

.logi-copy p {
    margin: 0 0 0 auto;
    max-width: 520px;
    color: #5c6f8a;
    font-size: 0.98rem;
    line-height: 1.6;
}

.logi-card {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(100%, 610px);
    align-items: center;
    gap: 23px;
    margin-left: auto;
    padding: 17px 20px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 28px;
    background: rgba(255,255,255,.58);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.logi-image {
    width: clamp(150px, 16vw, 235px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 13px 27px rgba(0,69,143,.17);
}

.speech-bubble {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 17px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(56, 93, 145, .10);
}

.speech-bubble::before {
    content: "";
    position: absolute;
    top: 31px;
    left: -9px;
    width: 18px;
    height: 18px;
    background: #fff;
    transform: rotate(45deg);
}

.speech-bubble strong {
    position: relative;
    color: var(--navy);
    font-size: 1rem;
}

.speech-bubble span {
    position: relative;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.5;
}

.feature-pills {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
    width: min(100%, 610px);
    margin: 18px 0 0 auto;
}

.feature-pills span {
    padding: 8px 11px;
    border: 1px solid rgba(0,94,184,.11);
    border-radius: 999px;
    background: rgba(255,255,255,.68);
    color: #43617f;
    font-size: .72rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 1050px) {
    .login-shell {
        grid-template-columns: minmax(400px, 55%) 1fr;
    }

    .visual-panel {
        padding-inline: 30px;
    }

    .logi-card {
        flex-direction: column;
        width: 100%;
    }

    .speech-bubble::before {
        display: none;
    }
}

@media (max-width: 820px) {
    .login-page {
        background:
            linear-gradient(rgba(247,251,255,.88), rgba(235,246,255,.88)),
            url("../assets/backgrounds/Background.png") center / cover no-repeat;
    }

    .login-shell {
        display: block;
    }

    .login-panel {
        min-height: 100vh;
        padding: 125px 22px 38px;
        border-right: 0;
        background: rgba(249,252,255,.72);
    }

    .brand {
        top: 26px;
        left: 22px;
    }

    .brand-logo {
        width: 180px;
    }

    .login-copy,
    .login-card,
    .security-note {
        width: min(100%, 520px);
        margin-left: auto;
        margin-right: auto;
    }

    .visual-panel {
        display: none;
    }
}

@media (max-width: 520px) {
    .login-copy {
        margin-top: 18px;
    }

    .login-copy h1 {
        font-size: 2rem;
    }

    .login-card {
        padding: 22px 18px;
        border-radius: 24px;
    }

    .card-heading {
        align-items: center;
    }

    .secure-chip {
        padding: 7px 8px;
        font-size: .68rem;
    }

    .form-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
