/* ==========================================================================
   MI LIBRO FAVORITO — AUTH EXPERIENCE
   Login / Registro
   ========================================================================== */

:root {
    --auth-primary: #6d3ce7;
    --auth-primary-dark: #4d22b7;
    --auth-primary-soft: #f4efff;
    --auth-ink: #17131f;
    --auth-muted: #716c7b;
    --auth-border: rgba(80, 55, 120, .14);
    --auth-danger: #c43f5d;
    --auth-success: #198754;
    --auth-shadow: 0 30px 80px rgba(48, 27, 87, .18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.mlf-auth-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 8%, rgba(124, 58, 237, .17), transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(99, 102, 241, .14), transparent 33%),
        #f7f5fb;
}

.mlf-auth-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.mlf-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .75;
    animation: mlfAuthFloat 12s ease-in-out infinite;
}

.mlf-auth-orb--one {
    width: 260px;
    height: 260px;
    top: -80px;
    left: -70px;
    background: linear-gradient(135deg, rgba(124, 58, 237, .22), rgba(99, 102, 241, .08));
}

.mlf-auth-orb--two {
    width: 340px;
    height: 340px;
    right: -120px;
    bottom: -130px;
    animation-delay: -4s;
    background: linear-gradient(135deg, rgba(91, 33, 182, .18), rgba(236, 72, 153, .08));
}

.mlf-auth-orb--three {
    width: 150px;
    height: 150px;
    right: 16%;
    top: 9%;
    animation-delay: -8s;
    background: rgba(124, 58, 237, .08);
}

.mlf-auth-book {
    position: absolute;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(124, 58, 237, .1);
    border-radius: 18px;
    color: rgba(91, 33, 182, .28);
    background: rgba(255, 255, 255, .62);
    box-shadow: 0 16px 35px rgba(54, 32, 88, .08);
    backdrop-filter: blur(9px);
    animation: mlfAuthBookFloat 8s ease-in-out infinite;
}

.mlf-auth-book--one {
    left: 5%;
    bottom: 9%;
}

.mlf-auth-book--two {
    right: 6%;
    top: 16%;
    animation-delay: -2.5s;
}

.mlf-auth-book--three {
    right: 11%;
    bottom: 16%;
    animation-delay: -5s;
}

.mlf-auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
}

.mlf-auth-frame {
    width: min(1180px, 100%);
    min-height: 720px;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(420px, .98fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 32px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(22px);
    animation: mlfAuthEnter .6s cubic-bezier(.2, .8, .2, 1) both;
}

.mlf-auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 42px;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(39, 20, 76, .98), rgba(91, 33, 182, .93)),
        #4d22b7;
}

.mlf-auth-story::before,
.mlf-auth-story::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.mlf-auth-story::before {
    width: 420px;
    height: 420px;
    right: -220px;
    top: -110px;
    border: 1px solid rgba(255, 255, 255, .11);
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, .025),
        0 0 0 110px rgba(255, 255, 255, .018);
}

.mlf-auth-story::after {
    width: 240px;
    height: 240px;
    left: -100px;
    bottom: -90px;
    background: rgba(255, 255, 255, .05);
}

.mlf-auth-brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #fff;
    text-decoration: none;
}

.mlf-auth-brand:hover {
    color: #fff;
}

.mlf-auth-brand__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}

.mlf-auth-brand strong,
.mlf-auth-brand small {
    display: block;
}

.mlf-auth-brand strong {
    font-size: 1rem;
    letter-spacing: -.01em;
}

.mlf-auth-brand small {
    margin-top: 1px;
    color: rgba(255, 255, 255, .65);
    font-size: .73rem;
}

.mlf-auth-story__content {
    position: relative;
    z-index: 2;
    margin: auto 0;
    max-width: 510px;
}

.mlf-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .07);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.mlf-auth-story h1 {
    margin: 0 0 22px;
    max-width: 500px;
    color: #fff;
    font-size: clamp(2.35rem, 4.3vw, 4rem);
    line-height: 1.02;
    letter-spacing: -.045em;
}

.mlf-auth-story__content > p {
    margin: 0;
    max-width: 510px;
    color: rgba(255, 255, 255, .72);
    font-size: 1rem;
    line-height: 1.75;
}

.mlf-auth-benefits {
    display: grid;
    gap: 13px;
    margin-top: 34px;
}

.mlf-auth-benefits > div {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.mlf-auth-benefits > div > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.mlf-auth-benefits p {
    margin: 0;
    color: rgba(255, 255, 255, .62);
    font-size: .84rem;
}

.mlf-auth-benefits strong {
    display: block;
    margin-bottom: 1px;
    color: #fff;
    font-size: .9rem;
}

.mlf-auth-story__footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255,255,255,.55);
    font-size: .78rem;
}

.mlf-auth-story__footer a {
    color: rgba(255,255,255,.78);
    text-decoration: none;
}

.mlf-auth-story__footer a:hover {
    color: #fff;
}

.mlf-auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    padding: 56px clamp(34px, 6vw, 74px);
    background: rgba(255, 255, 255, .88);
}

.mlf-auth-panel__inner {
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
}

.mlf-auth-mobile-brand {
    display: none;
}

.mlf-auth-heading {
    margin-bottom: 28px;
}

.mlf-auth-heading__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border: 1px solid rgba(124, 58, 237, .12);
    border-radius: 16px;
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    box-shadow: 0 10px 28px rgba(124, 58, 237, .08);
}

.mlf-auth-heading h2 {
    margin: 0 0 8px;
    color: var(--auth-ink);
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.035em;
}

.mlf-auth-heading p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.65;
}

.mlf-auth-status {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(25, 135, 84, .18);
    border-radius: 14px;
    color: #146c43;
    background: rgba(25, 135, 84, .07);
    font-size: .86rem;
}

.mlf-auth-field {
    margin-bottom: 17px;
}

.mlf-auth-field label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: #36303f;
    font-size: .86rem;
    font-weight: 700;
}

.mlf-auth-input-wrap {
    position: relative;
}

.mlf-auth-input-wrap > i {
    position: absolute;
    left: 15px;
    top: 50%;
    z-index: 2;
    color: #a29aaa;
    transform: translateY(-50%);
    pointer-events: none;
}

.mlf-auth-input {
    width: 100%;
    min-height: 52px;
    padding: 12px 44px 12px 44px;
    border: 1px solid #e4dfea;
    border-radius: 15px;
    outline: none;
    color: var(--auth-ink);
    background: #fff;
    font-size: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.mlf-auth-input::placeholder {
    color: #aaa3b1;
}

.mlf-auth-input:hover {
    border-color: #d3c8e5;
}

.mlf-auth-input:focus {
    border-color: rgba(124, 58, 237, .56);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .1);
}

.mlf-auth-password-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #877e90;
    background: transparent;
    transform: translateY(-50%);
    transition: color .18s ease, background .18s ease;
}

.mlf-auth-password-toggle:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.mlf-auth-error {
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: .78rem;
}

.mlf-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 22px;
}

.mlf-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: .84rem;
    cursor: pointer;
}

.mlf-auth-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-primary);
}

.mlf-auth-link {
    color: var(--auth-primary);
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}

.mlf-auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.mlf-auth-submit {
    position: relative;
    width: 100%;
    min-height: 52px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    box-shadow: 0 14px 28px rgba(91, 33, 182, .22);
    font-size: .94rem;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease;
}

.mlf-auth-submit::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.22) 50%, transparent 75%);
    transition: transform .55s ease;
}

.mlf-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(91, 33, 182, .28);
}

.mlf-auth-submit:hover::after {
    transform: translateX(120%);
}

.mlf-auth-submit span,
.mlf-auth-submit i {
    position: relative;
    z-index: 2;
}

.mlf-auth-switch {
    margin: 24px 0 0;
    padding-top: 22px;
    border-top: 1px solid #eee9f2;
    color: var(--auth-muted);
    font-size: .88rem;
    text-align: center;
}

.mlf-auth-switch a {
    color: var(--auth-primary);
    font-weight: 800;
    text-decoration: none;
}

.mlf-auth-switch a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.mlf-auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: #9b94a2;
    font-size: .76rem;
}

.mlf-auth-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 9px;
}

.mlf-auth-strength span {
    height: 4px;
    border-radius: 999px;
    background: #e9e5ec;
    transition: background .2s ease;
}

.mlf-auth-strength[data-score="1"] span:nth-child(1),
.mlf-auth-strength[data-score="2"] span:nth-child(-n+2),
.mlf-auth-strength[data-score="3"] span:nth-child(-n+3),
.mlf-auth-strength[data-score="4"] span:nth-child(-n+4) {
    background: var(--auth-primary);
}

.mlf-auth-strength[data-score="1"] span:nth-child(1) {
    background: #dc3545;
}

.mlf-auth-strength[data-score="2"] span:nth-child(-n+2) {
    background: #f0ad4e;
}

.mlf-auth-strength[data-score="4"] span:nth-child(-n+4) {
    background: #198754;
}

.mlf-auth-strength-label {
    display: block;
    margin-top: 6px;
    color: #8b8492;
    font-size: .74rem;
}


/* --------------------------------------------------------------------------
   Búho lector dentro de la experiencia de autenticación
   -------------------------------------------------------------------------- */
.mlf-auth-mascot {
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: 430px;
    margin-top: 26px;
    padding: 10px 14px 10px 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(10px);
}

.mlf-auth-mascot__character {
    flex: 0 0 auto;
}

.mlf-auth-mascot .mlf-article-mascot-card {
    width: 78px;
    height: 78px;
    padding: .3rem;
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 26px rgba(20, 9, 45, .16);
}

.mlf-auth-mascot .mlf-page-mascot--compact {
    width: 66px;
    height: 66px;
}

.mlf-auth-mascot__copy span {
    display: block;
    margin-bottom: 2px;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
}

.mlf-auth-mascot__copy p {
    margin: 0;
    color: rgba(255, 255, 255, .66);
    font-size: .78rem;
    line-height: 1.45;
}

.mlf-auth-mobile-mascot {
    display: none;
}

@keyframes mlfAuthEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes mlfAuthFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(16px, -14px, 0) scale(1.04); }
}

@keyframes mlfAuthBookFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-13px) rotate(3deg); }
}

@media (max-width: 991.98px) {
    .mlf-auth-shell {
        padding: 20px;
    }

    .mlf-auth-frame {
        min-height: auto;
        grid-template-columns: 1fr;
        max-width: 620px;
    }

    .mlf-auth-story {
        display: none;
    }

    .mlf-auth-panel {
        min-height: min(760px, calc(100vh - 40px));
        padding: 42px 34px;
    }

    .mlf-auth-mobile-brand {
        position: absolute;
        top: 24px;
        left: 30px;
        display: block;
    }

    .mlf-auth-mobile-mascot {
        position: absolute;
        top: 18px;
        right: 24px;
        display: block;
        transform: scale(.72);
        transform-origin: top right;
    }

    .mlf-auth-mobile-mascot .mlf-article-mascot-card {
        box-shadow: 0 10px 24px rgba(54, 32, 88, .12);
    }

    .mlf-auth-mobile-brand a {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        color: var(--auth-primary-dark);
        text-decoration: none;
    }

    .mlf-auth-mobile-brand span {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background: var(--auth-primary-soft);
    }

    .mlf-auth-panel__inner {
        margin-top: 46px;
    }
}

@media (max-width: 575.98px) {
    .mlf-auth-shell {
        display: block;
        padding: 0;
    }

    .mlf-auth-frame {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mlf-auth-panel {
        min-height: 100vh;
        padding: 90px 22px 30px;
    }

    .mlf-auth-mobile-brand {
        top: 24px;
        left: 22px;
    }

    .mlf-auth-mobile-mascot {
        top: 13px;
        right: 10px;
        transform: scale(.62);
    }

    .mlf-auth-panel__inner {
        margin-top: 0;
    }

    .mlf-auth-heading {
        margin-bottom: 24px;
    }

    .mlf-auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .mlf-auth-book {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mlf-auth-frame,
    .mlf-auth-orb,
    .mlf-auth-book,
    .mlf-auth-submit::after {
        animation: none !important;
        transition: none !important;
    }
}
