:root {
    --gold: #e8b923;
    --gold-dark: #b8860b;
    --brown: #9a6633;
    --ink: #1c1a17;
    --muted: #6f6a63;
    --card: #fdfbf7;
    --line: #ebe5da;
    --radius: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: #2a2118 url('../images/fondo.jpg') center / cover no-repeat fixed;
}

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 2rem;
    padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 5vw, 5rem);
    /* Oscurece la foto hacia la izquierda y la aclara hacia el formulario */
    background:
        linear-gradient(90deg, rgba(20, 14, 8, .78) 0%, rgba(20, 14, 8, .35) 45%, rgba(253, 246, 230, .55) 100%);
}

/* ---------- Panel izquierdo ---------- */
.hero {
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: stretch;
    gap: 3rem;
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand img { height: 46px; filter: brightness(0) invert(1); }
.brand span { font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; }

.hero h1 {
    font-size: clamp(2.4rem, 4.2vw, 3.6rem);
    line-height: 1.1;
    font-weight: 700;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero h1 strong { display: block; color: var(--gold); font-weight: 800; }
.hero p { margin-top: 1.25rem; max-width: 26rem; font-size: 1.05rem; line-height: 1.5; opacity: .95; }

.features { display: flex; gap: 2.5rem; list-style: none; margin-top: 2.5rem; }
.features li { text-align: center; font-size: .85rem; font-weight: 500; line-height: 1.3; }
.features i {
    display: grid; place-items: center;
    width: 48px; height: 48px; margin: 0 auto .5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(4px);
    color: var(--gold);
    font-size: 1.2rem;
}

/* ---------- Tarjeta ---------- */
.card {
    justify-self: end;
    width: 100%;
    max-width: 560px;
    background: var(--card);
    border-radius: var(--radius);
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem) 1.75rem;
    box-shadow: 0 30px 60px -20px rgba(40, 25, 5, .45);
    text-align: center;
}

.card-logo {
    width: 104px; height: 104px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f5ead6;
    display: grid; place-items: center;
}
.card-logo img { width: 62px; }

.card h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: .01em; }
.card .hello { margin-top: .5rem; font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.card .sub { font-size: .9rem; color: var(--muted); margin-bottom: 2rem; }

.field { position: relative; margin-bottom: 1rem; }
.field > i {
    position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%);
    color: #8a847b; font-size: 1.05rem; pointer-events: none;
}
.field input {
    width: 100%;
    height: 52px;
    padding: 0 3rem 0 3.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(232, 185, 35, .18);
}
.toggle-pass {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: #8a847b; font-size: 1.05rem; cursor: pointer;
}
.toggle-pass:hover, .toggle-pass:focus-visible { background: #f3eee5; color: var(--ink); outline: none; }

.remember {
    display: flex; align-items: center; gap: .6rem;
    margin: .5rem 0 1.75rem;
    font-size: .9rem; color: #4a4640; cursor: pointer; user-select: none;
    width: fit-content;
}
.remember input { width: 20px; height: 20px; accent-color: var(--gold-dark); cursor: pointer; }

.btn-login {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(184, 134, 11, .8);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
/* Flecha vía CSS: el JS reemplaza el HTML del botón con .html() */
.btn-login::after { content: '\2192'; margin-left: .75rem; display: inline-block; transition: transform .2s; }
.btn-login:hover { filter: brightness(1.05); box-shadow: 0 14px 26px -10px rgba(184, 134, 11, .9); }
.btn-login:hover::after { transform: translateX(4px); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: 3px solid rgba(232, 185, 35, .45); outline-offset: 3px; }
.btn-login:disabled { opacity: .7; cursor: wait; }
.btn-login:disabled::after { content: none; }

.card footer {
    margin-top: 2rem; padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .8rem; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .login {
        grid-template-columns: 1fr;
        justify-items: center;
        align-content: center;
        gap: 1.5rem;
        background: linear-gradient(180deg, rgba(20, 14, 8, .65) 0%, rgba(20, 14, 8, .35) 100%);
    }
    .hero { align-self: auto; gap: 0; text-align: center; }
    .brand { justify-content: center; }
    .hero-text, .features { display: none; }
    .card { justify-self: center; }
}

@media (max-width: 480px) {
    body { background-attachment: scroll; }
    .login { padding: 1.5rem 16px; }
    .brand img { height: 36px; }
    .brand span { font-size: 1.1rem; }
    .card { border-radius: 22px; }
    .card-logo { width: 84px; height: 84px; }
    .card-logo img { width: 50px; }
    .card h2 { font-size: 1.35rem; }
    .card .sub { margin-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
