.nav-cta {
    padding: 9px 14px;
    border-radius: 12px;
    color: white !important;
    background: var(--navy);
}
.nav-admin { color: var(--coral); }
.flash-wrap { position: relative; z-index: 10; }
.flash-message {
    margin-top: 16px;
    padding: 13px 16px;
    border: 1px solid #cfe3d2;
    border-radius: 14px;
    background: #f1faf2;
    color: #315d39;
    font-weight: 750;
}

.auth-section {
    min-height: calc(100vh - 76px);
    padding: 72px 0;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at 8% 10%, rgba(231, 184, 74, .22), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(47, 111, 176, .16), transparent 30%),
        #f7fbff;
}
.auth-grid { display: grid; grid-template-columns: 1fr minmax(390px, .78fr); gap: 80px; align-items: center; }
.auth-copy h1 { margin: 14px 0 20px; max-width: 660px; color: var(--navy); font-size: clamp(2.8rem, 5vw, 4.8rem); }
.auth-copy > p { max-width: 620px; color: var(--muted); font-size: 1.12rem; }
.auth-benefits { display: grid; gap: 10px; margin-top: 28px; color: var(--navy); font-weight: 800; }
.auth-card {
    padding: 34px;
    border: 1px solid rgba(23, 63, 115, .10);
    border-radius: 28px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 70px rgba(23, 63, 115, .14);
}
.auth-card-heading { display: flex; gap: 15px; align-items: center; margin-bottom: 28px; }
.auth-card-heading h2 { margin: 0; color: var(--navy); font-size: 1.7rem; }
.auth-card-heading p { margin: 4px 0 0; color: var(--muted); }
.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 8px; color: var(--ink); font-size: .88rem; font-weight: 850; }
.auth-form input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #d8e0e8;
    border-radius: 13px;
    outline: none;
    background: white;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 111, 176, .10); }
.form-alert { padding: 12px 14px; border-radius: 12px; background: #fff1ef; color: #9f3f33; font-weight: 750; }
.field-error { color: #b44235; font-weight: 700; }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--muted); }
.auth-switch a { color: var(--navy); font-weight: 900; }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.account-card {
    display: flex;
    gap: 20px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: white;
    box-shadow: 0 8px 26px rgba(23, 63, 115, .06);
}
.account-card-primary { background: linear-gradient(145deg, #f1f8ff, #fffaf0); }
.account-icon { font-size: 2.2rem; }
.account-card small { color: var(--coral); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.account-card h2 { margin: 5px 0 8px; color: var(--navy); }
.account-card p { margin: 0 0 20px; color: var(--muted); }

.purchase-list { display: grid; gap: 24px; }
.purchase-card { border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: white; box-shadow: 0 8px 30px rgba(23, 63, 115, .06); }
.purchase-head { display: flex; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.purchase-head h2 { margin: 7px 0 0; color: var(--navy); font-size: 1.25rem; }
.status-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: #315d39; background: #eaf7ec; font-size: .76rem; font-weight: 900; text-transform: uppercase; }
.purchase-meta { display: grid; justify-items: end; align-content: center; gap: 2px; color: var(--muted); }
.purchase-meta strong { color: var(--navy); }
.purchase-product { display: grid; grid-template-columns: .75fr 1.25fr; gap: 34px; padding: 28px; }
.purchase-product-copy h3 { margin: 7px 0 8px; color: var(--navy); font-size: 1.45rem; }
.purchase-product-copy p { margin: 0; color: var(--muted); }
.file-list { display: grid; gap: 10px; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfd; }
.file-row strong, .file-row small { display: block; }
.file-row small { margin-top: 2px; color: var(--muted); }
.btn-compact { min-height: 40px; padding: 0 15px; font-size: .86rem; }
.file-pending { color: var(--muted); font-size: .82rem; font-weight: 800; }
.file-empty { padding: 18px; border: 1px dashed #ccd6e0; border-radius: 15px; color: var(--muted); }
.library-empty { padding: 60px 30px; border: 1px dashed #ccd6e0; border-radius: 26px; text-align: center; background: white; }
.library-empty > span { font-size: 3.4rem; }
.library-empty h2 { margin: 12px 0 8px; color: var(--navy); font-size: 2rem; }
.library-empty p { max-width: 600px; margin: 0 auto 24px; color: var(--muted); }

@media (max-width: 900px) {
    .auth-grid { grid-template-columns: 1fr; gap: 36px; }
    .auth-copy { text-align: center; }
    .auth-copy h1, .auth-copy > p { margin-left: auto; margin-right: auto; }
    .auth-benefits { justify-items: center; }
    .account-grid { grid-template-columns: 1fr; }
    .purchase-product { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .main-nav { overflow-x: auto; white-space: nowrap; max-width: 62vw; }
    .main-nav a { display: inline-flex !important; }
    .nav-admin { display: none !important; }
    .auth-section { padding: 44px 0; }
    .auth-card { padding: 24px; border-radius: 22px; }
    .purchase-head { flex-direction: column; }
    .purchase-meta { justify-items: start; }
    .file-row { align-items: flex-start; flex-direction: column; }
}


.checkout-section {
    padding: 72px 0 90px;
    background:
        radial-gradient(circle at 5% 10%, rgba(242,189,77,.14), transparent 24%),
        radial-gradient(circle at 92% 15%, rgba(53,121,189,.12), transparent 27%),
        #f8fbfd;
}
.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr);
    gap: 64px;
    align-items: start;
}
.checkout-back {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 800;
}
.checkout-summary h1 {
    max-width: 720px;
    margin: 10px 0 15px;
    color: var(--navy-deep);
    font-size: clamp(2.6rem, 5vw, 4.5rem);
}
.checkout-summary > p {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.04rem;
}
.checkout-product-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow-sm);
}
.checkout-product-icon {
    width: 58px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--sky), var(--cream));
    font-size: 1.8rem;
}
.checkout-product-card small,
.checkout-product-card strong,
.checkout-product-card span { display: block; }
.checkout-product-card small {
    color: var(--coral-deep);
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
}
.checkout-product-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .8rem;
}
.checkout-price {
    color: var(--navy-deep);
    white-space: nowrap;
}
.checkout-security {
    display: grid;
    gap: 8px;
    margin-top: 24px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}
.checkout-card {
    padding: 32px;
    border: 1px solid rgba(23,63,115,.10);
    border-radius: 28px;
    background: white;
    box-shadow: var(--shadow);
}
.checkout-card h2 {
    margin: 8px 0;
    color: var(--navy-deep);
    font-size: 1.85rem;
}
.checkout-card > p {
    margin: 0 0 18px;
    color: var(--muted);
}
.checkout-legal {
    margin: 14px 0 0 !important;
    text-align: center;
    color: var(--muted);
    font-size: .76rem;
}
.checkout-result-section {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 80px 0;
    background: linear-gradient(150deg, #f7fbff, #fffaf1);
}
.checkout-result-card {
    max-width: 680px;
    margin-inline: auto;
    padding: clamp(34px, 6vw, 62px);
    border: 1px solid var(--line);
    border-radius: 32px;
    text-align: center;
    background: white;
    box-shadow: var(--shadow);
}
.result-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    color: white;
    background: var(--sage);
    font-size: 2rem;
    font-weight: 900;
}
.result-icon-muted { background: var(--coral); }
.result-icon-pending { color: var(--navy); background: var(--sky); }
.checkout-result-card h1 {
    margin: 8px 0 14px;
    color: var(--navy-deep);
    font-size: clamp(2.3rem, 5vw, 3.8rem);
}
.checkout-result-card p { color: var(--muted); }
.checkout-result-card .btn { margin-top: 16px; }

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }
}

@media (max-width: 620px) {
    .checkout-section { padding: 42px 0 64px; }
    .checkout-card {
        padding: 24px;
        border-radius: 22px;
    }
    .checkout-product-card {
        grid-template-columns: auto 1fr;
    }
    .checkout-price {
        grid-column: 2;
    }
}


/* Checkout API */
.checkout-api-card {
    min-height: 470px;
}

.checkout-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;
    margin-bottom: 28px;
    color: #91a0ae;
    font-size: .78rem;
    font-weight: 850;
}

.checkout-progress span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.checkout-progress b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #728292;
    background: #edf1f4;
    font-size: .72rem;
}

.checkout-progress i {
    height: 2px;
    border-radius: 999px;
    background: #e5ebf0;
}

.checkout-progress .is-active {
    color: var(--navy-deep);
}

.checkout-progress .is-active b {
    color: white;
    background: var(--navy);
}

.checkout-progress .is-complete {
    color: #457553;
}

.checkout-progress .is-complete b {
    color: white;
    background: var(--sage);
}

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

.payment-step-heading h2 {
    margin-bottom: 0;
}

.checkout-edit-data {
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--navy);
    background: #fff;
    font-size: .76rem;
    font-weight: 850;
    cursor: pointer;
}

.live-card-stage {
    display: grid;
    place-items: center;
    padding: 10px 0 18px;
    perspective: 1000px;
}

.live-card {
    width: min(100%, 390px);
    aspect-ratio: 1.586 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px 27px 23px;
    border-radius: 23px;
    color: white;
    background:
        radial-gradient(circle at 78% 18%, rgba(255,255,255,.18), transparent 28%),
        linear-gradient(135deg, #0f2f57, #2467a9);
    box-shadow: 0 24px 55px rgba(14,43,80,.24);
    transform-style: preserve-3d;
    transition:
        background .35s ease,
        transform .35s ease,
        box-shadow .35s ease;
}

.live-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, transparent 20%, rgba(255,255,255,.07) 45%, transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}

.live-card.brand-pop {
    animation: card-brand-pop .38s ease;
}

.live-card.is-processing::before {
    animation: card-scan 1.05s ease-in-out infinite;
}

.live-card.is-processing {
    transform: rotateY(-3deg) rotateX(2deg) translateY(-2px);
    box-shadow: 0 28px 65px rgba(14,43,80,.30);
}

.live-card.is-visa {
    background:
        radial-gradient(circle at 80% 15%, rgba(255,255,255,.18), transparent 27%),
        linear-gradient(135deg, #0b3a86, #1565c0);
}

.live-card.is-mastercard {
    background:
        radial-gradient(circle at 87% 18%, rgba(239,117,95,.28), transparent 25%),
        linear-gradient(135deg, #232f43, #111827);
}

.live-card.is-amex {
    background:
        radial-gradient(circle at 83% 18%, rgba(255,255,255,.16), transparent 26%),
        linear-gradient(135deg, #0a6485, #1591b3);
}

.live-card-top,
.live-card-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.live-card-chip {
    width: 46px;
    height: 35px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent 46%, rgba(84,66,22,.25) 47%, rgba(84,66,22,.25) 52%, transparent 53%),
        linear-gradient(0deg, transparent 46%, rgba(84,66,22,.22) 47%, rgba(84,66,22,.22) 52%, transparent 53%),
        linear-gradient(135deg, #f9dd83, #cda84a);
    box-shadow: inset 0 0 0 1px rgba(80,58,12,.18);
}

.live-card-brand {
    font-size: 1rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.live-card-number {
    position: relative;
    z-index: 2;
    margin-top: auto;
    margin-bottom: 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(1.18rem, 3.2vw, 1.58rem);
    font-weight: 800;
    letter-spacing: .08em;
    text-shadow: 0 2px 10px rgba(0,0,0,.12);
}

.live-card-bottom {
    align-items: end;
}

.live-card-bottom > div:first-child {
    min-width: 0;
}

.live-card-bottom small {
    display: block;
    margin-bottom: 3px;
    color: rgba(255,255,255,.66);
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.live-card-bottom strong {
    display: block;
    overflow: hidden;
    font-size: .78rem;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-card-shine {
    position: absolute;
    width: 170px;
    height: 170px;
    right: -74px;
    bottom: -86px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 26px rgba(255,255,255,.035),
        0 0 0 55px rgba(255,255,255,.025);
}

.live-card-caption {
    display: grid;
    gap: 3px;
    margin-bottom: 20px;
    text-align: center;
}

.live-card-caption span {
    color: var(--navy-deep);
    font-size: .82rem;
    font-weight: 800;
}

.live-card-caption small {
    color: var(--muted);
    font-size: .7rem;
}

.mp-brick-loading {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.mp-brick-loading[hidden] {
    display: none;
}

.mp-brick-loading span {
    width: 22px;
    height: 22px;
    border: 3px solid #e4ebf1;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: mp-spin .8s linear infinite;
}

.checkout-payment-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #efc7c1;
    border-radius: 12px;
    color: #944135;
    background: #fff4f2;
    font-size: .82rem;
    font-weight: 750;
}

.checkout-payment-alert[hidden] {
    display: none;
}

#cardPaymentBrick_container {
    min-height: 110px;
}

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

@keyframes card-brand-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.018) rotateY(-2deg); }
}

@keyframes card-scan {
    0% { transform: translateX(-125%); }
    100% { transform: translateX(145%); }
}

@media (max-width: 620px) {
    .checkout-api-card {
        padding: 21px;
    }

    .checkout-progress {
        gap: 7px;
        font-size: .7rem;
    }

    .checkout-progress b {
        width: 25px;
        height: 25px;
    }

    .payment-step-heading {
        flex-direction: column;
        gap: 9px;
    }

    .live-card {
        padding: 21px 21px 19px;
        border-radius: 20px;
    }

    .live-card-number {
        margin-bottom: 17px;
        font-size: clamp(1rem, 5vw, 1.3rem);
        letter-spacing: .045em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-card,
    .live-card::before,
    .mp-brick-loading span {
        animation: none !important;
        transition: none !important;
    }
}


/* Biblioteca / Mis compras */
.library-hero {
    position: relative;
    overflow: hidden;
    padding: 68px 0 56px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 92% 12%, rgba(53,121,189,.12), transparent 26%),
        radial-gradient(circle at 7% 95%, rgba(242,189,77,.12), transparent 22%),
        linear-gradient(180deg, #fbfdff 0%, #fffdf9 100%);
}

.library-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: 7%;
    bottom: -205px;
    border: 1px solid rgba(23,63,115,.07);
    border-radius: 50%;
    box-shadow:
        0 0 0 34px rgba(23,63,115,.025),
        0 0 0 68px rgba(23,63,115,.018);
    pointer-events: none;
}

.library-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 48px;
}

.library-hero-copy { min-width: 0; }

.library-hero-copy h1 {
    margin: 8px 0 12px;
    color: var(--navy-deep);
    font-size: clamp(3.25rem, 7vw, 5.8rem);
    line-height: .94;
    letter-spacing: -.055em;
}

.library-hero-copy p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
}

.library-hero-summary {
    min-width: 270px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 13px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(23,63,115,.09);
    border-radius: 21px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 18px 42px rgba(23,63,115,.07);
    backdrop-filter: blur(10px);
}

.library-summary-icon {
    width: 49px;
    height: 49px;
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #eef7ff, #fff8e9);
    font-size: 1.45rem;
}

.library-hero-summary > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.library-hero-summary strong {
    color: var(--navy-deep);
    font-size: 1.4rem;
    line-height: 1;
}

.library-hero-summary span:not(.library-summary-icon) {
    color: var(--ink);
    font-size: .8rem;
    font-weight: 800;
}

.library-hero-summary small {
    grid-column: 2;
    color: var(--muted);
    font-size: .7rem;
}

.library-section {
    padding: 58px 0 92px;
    background: linear-gradient(180deg, #f7fafc 0%, #fff 42%);
}

.library-purchase-list { gap: 30px; }

.library-order-card {
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 18px 52px rgba(23,63,115,.07);
}

.library-order-head {
    padding: 20px 26px;
    align-items: center;
    background: linear-gradient(90deg, rgba(238,247,255,.78), rgba(255,252,245,.7));
}

.library-order-identity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.library-order-identity > div { min-width: 0; }

.library-order-identity small,
.library-order-meta small {
    display: block;
    margin-bottom: 3px;
    color: #8796a5;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .11em;
}

.library-order-identity h2 {
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}

.status-badge-ready {
    min-height: 34px;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    color: #2e6b42;
    border: 1px solid #d4eadb;
    background: #edf8f0;
    font-size: .67rem;
}

.status-badge-ready > span {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #4f9565;
    font-size: .65rem;
}

.library-order-meta {
    grid-template-columns: auto auto;
    gap: 34px;
    align-items: center;
}

.library-order-meta > div {
    display: grid;
    justify-items: end;
}

.library-order-meta span {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 750;
}

.library-order-meta strong { font-size: 1rem; }

.library-product {
    grid-template-columns: minmax(340px, .8fr) minmax(420px, 1.2fr);
    gap: 42px;
    padding: 34px;
    background:
        radial-gradient(circle at 3% 8%, rgba(242,189,77,.07), transparent 18%),
        #fff;
}

.library-product-main {
    min-width: 0;
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 22px;
    align-items: start;
}

.library-product-cover {
    width: 118px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px solid rgba(23,63,115,.10);
    border-radius: 18px;
    color: var(--navy);
    background:
        radial-gradient(circle at 20% 15%, rgba(242,189,77,.16), transparent 28%),
        linear-gradient(145deg, #eef7ff, #fffaf0);
    box-shadow: 0 14px 30px rgba(23,63,115,.10);
    transition: transform .2s ease, box-shadow .2s ease;
}

.library-product-cover:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 38px rgba(23,63,115,.14);
}

.library-product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-product-cover > span { font-size: 2rem; }

.library-product-cover > small {
    max-width: 90px;
    text-align: center;
    color: var(--navy);
    font-size: .62rem;
    font-weight: 850;
}

.library-product-copy {
    min-width: 0;
    padding-top: 5px;
}

.library-product-copy .product-collection {
    color: var(--coral-deep);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.library-product-copy h3 {
    margin: 8px 0 10px;
    color: var(--navy-deep);
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.library-product-copy p {
    max-width: 430px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.62;
}

.library-product-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 21px;
}

.library-product-link {
    color: var(--navy);
    font-size: .8rem;
    font-weight: 900;
}

.library-product-link span {
    display: inline-block;
    transition: transform .18s ease;
}

.library-product-link:hover span { transform: translateX(3px); }

.library-safe-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #647687;
    font-size: .72rem;
    font-weight: 750;
}

.library-files-panel {
    min-width: 0;
    padding: 23px;
    border: 1px solid #dde6ed;
    border-radius: 23px;
    background: #f9fbfd;
}

.library-files-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    padding: 0 2px;
}

.library-files-heading .eyebrow { font-size: .62rem; }

.library-files-heading h4 {
    margin: 3px 0 0;
    color: var(--navy-deep);
    font-size: 1.2rem;
}

.library-file-count {
    padding: 6px 9px;
    border-radius: 999px;
    color: #657687;
    background: #edf2f6;
    font-size: .67rem;
    font-weight: 850;
    white-space: nowrap;
}

.library-file-list { gap: 9px; }

.library-file-row {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 13px;
    padding: 11px 12px;
    border: 1px solid #e1e8ee;
    border-radius: 16px;
    background: #fff;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.library-file-row:hover {
    border-color: #ccd9e4;
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(23,63,115,.055);
}

.file-type-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--navy);
    background: #edf5fb;
    font-size: .62rem;
    font-weight: 950;
    letter-spacing: .03em;
}

.library-file-info {
    min-width: 0;
    align-self: center;
}

.library-file-info strong {
    overflow: hidden;
    color: var(--navy-deep);
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-file-info small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
    color: var(--muted);
    font-size: .7rem;
}

.library-download-btn {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    align-self: center;
    padding: 0 14px;
    border: 1px solid #d6e1ea;
    border-radius: 12px;
    color: var(--navy-deep);
    background: #fff;
    font-size: .76rem;
    font-weight: 900;
    box-shadow: 0 5px 14px rgba(23,63,115,.04);
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.library-download-btn:hover {
    color: #fff;
    border-color: var(--navy);
    background: var(--navy);
    transform: translateY(-1px);
}

.library-download-icon {
    font-size: 1rem;
    line-height: 1;
}

.library-files-footnote {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 13px 2px 0;
    color: #728393;
    font-size: .67rem;
    font-weight: 700;
}

.library-files-footnote span {
    color: #5c956b;
    font-size: .5rem;
}

.library-empty-redesign {
    padding: 70px 30px;
    border: 1px solid #dce5ed;
    border-radius: 30px;
    background:
        radial-gradient(circle at 15% 10%, rgba(242,189,77,.12), transparent 25%),
        radial-gradient(circle at 90% 85%, rgba(53,121,189,.10), transparent 25%),
        #fff;
    box-shadow: 0 18px 52px rgba(23,63,115,.06);
}

.library-empty-art {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: linear-gradient(145deg, #eef7ff, #fff5dd);
    font-size: 2rem !important;
}

.library-empty-redesign h2 { margin-top: 9px; }

@media (max-width: 1040px) {
    .library-product { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .library-hero { padding: 48px 0 42px; }

    .library-hero-inner {
        align-items: stretch;
        flex-direction: column;
        gap: 25px;
    }

    .library-hero-summary {
        min-width: 0;
        width: 100%;
    }

    .library-section { padding: 34px 0 64px; }

    .library-order-head {
        align-items: stretch;
        flex-direction: column;
        gap: 17px;
        padding: 18px;
    }

    .library-order-identity {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .library-order-meta {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding-top: 14px;
        border-top: 1px solid var(--line);
    }

    .library-order-meta > div { justify-items: start; }

    .library-product { padding: 20px; }

    .library-product-main {
        grid-template-columns: 92px 1fr;
        gap: 16px;
    }

    .library-product-cover {
        width: 92px;
        border-radius: 15px;
    }

    .library-product-copy h3 { font-size: 1.35rem; }
    .library-product-copy p { font-size: .83rem; }

    .library-files-panel {
        padding: 16px;
        border-radius: 19px;
    }
}

@media (max-width: 540px) {
    .library-product-main { grid-template-columns: 1fr; }
    .library-product-cover { width: 112px; }

    .library-files-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .library-file-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .library-download-btn,
    .file-pending {
        grid-column: 1 / -1;
        width: 100%;
    }

    .library-download-btn { min-height: 46px; }
    .library-file-info strong { white-space: normal; }
}


/* Compra invitado -> cuenta */
.purchase-account-next {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 24px auto 2px;
    padding: 15px 17px;
    border: 1px solid #dce6ee;
    border-radius: 16px;
    text-align: left;
    background: #f8fbfd;
}

.purchase-account-next > span {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #edf5fb;
    font-size: 1.1rem;
}

.purchase-account-next strong,
.purchase-account-next small {
    display: block;
}

.purchase-account-next strong {
    color: var(--navy-deep);
    font-size: .9rem;
}

.purchase-account-next small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.45;
}

.purchase-claim-note {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: -8px 0 19px;
    padding: 12px 14px;
    border: 1px solid #d7eadc;
    border-radius: 14px;
    background: #f0f8f2;
}

.purchase-claim-note > span {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: #5a9469;
    font-size: .78rem;
    font-weight: 900;
}

.purchase-claim-note strong,
.purchase-claim-note small {
    display: block;
}

.purchase-claim-note strong {
    color: #315f3d;
    font-size: .82rem;
}

.purchase-claim-note small {
    margin-top: 1px;
    color: #68806f;
    font-size: .7rem;
}

.auth-form input:disabled {
    color: #536576;
    border-color: #dde5eb;
    background: #f2f5f7;
    cursor: not-allowed;
}

.locked-email-note {
    margin-top: -2px;
    color: #738493;
    font-size: .7rem;
    line-height: 1.4;
}
