/* =========================================================
   Portal de la Coope — estilo juvenil y escolar
   Coral + turquesa + amarillo + violeta (base: naranja del logo)
   ========================================================= */

:root {
    --orange: #ff6b35;
    --orange-strong: #ee4d1f;
    --pink: #ff5f8f;
    --yellow: #ffd23f;
    --teal: #2ec4b6;
    --teal-strong: #14a89b;
    --sky: #4cc9f0;
    --grape: #7b61ff;
    --cream: #fffaf3;
    --white: #ffffff;
    --ink: #2b2440;
    --muted: #6f6a86;
    --line: #ece9f5;
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 13px;
    --shadow-lg: 0 34px 70px -34px rgba(84, 44, 120, .45);
    --shadow-md: 0 20px 45px -26px rgba(84, 44, 120, .38);
    --shadow-sm: 0 10px 24px -14px rgba(84, 44, 120, .30);
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Quicksand', 'Poppins', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(900px 520px at 0% -8%, #d9f6ff 0%, rgba(217, 246, 255, 0) 62%),
        radial-gradient(820px 520px at 100% 0%, #ffe4d1 0%, rgba(255, 228, 209, 0) 58%),
        radial-gradient(760px 520px at 50% 112%, #e9e4ff 0%, rgba(233, 228, 255, 0) 62%),
        linear-gradient(180deg, #fbfdff 0%, #fffaf3 100%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Decoración de fondo --- */
.page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
}

.page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image: radial-gradient(rgba(43, 36, 64, .05) 1.4px, transparent 1.4px);
    background-size: 24px 24px;
    opacity: .5;
    pointer-events: none;
}

.blob {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(6px);
    opacity: .55;
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
}

.blob-1 {
    width: 360px;
    height: 360px;
    top: -140px;
    left: -110px;
    background: radial-gradient(circle at 30% 30%, #b6f2ec, #8ee6dd 68%, transparent 70%);
}

.blob-2 {
    width: 440px;
    height: 440px;
    top: 90px;
    right: -190px;
    background: radial-gradient(circle at 40% 40%, #ffd9c2, #ffc4a3 68%, transparent 70%);
    opacity: .45;
    animation-delay: -4s;
}

.blob-3 {
    width: 280px;
    height: 280px;
    bottom: 60px;
    left: -120px;
    background: radial-gradient(circle at 40% 40%, #ded6ff, #c8bcff 68%, transparent 70%);
    opacity: .45;
    animation-delay: -7s;
}

.wrap {
    width: min(1080px, 100% - 2.5rem);
    margin: 0 auto;
    padding: 2.5rem 0 1rem;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 1rem 0 2.5rem;
    animation: rise .6s ease both;
}

.logo-card {
    width: 152px;
    height: 152px;
    margin: 0 auto 1.4rem;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 38px;
    border: 4px solid transparent;
    background:
        linear-gradient(var(--white), var(--white)) padding-box,
        conic-gradient(from 210deg, var(--teal), var(--sky), var(--grape), var(--pink), var(--yellow), var(--orange), var(--teal)) border-box;
    box-shadow: var(--shadow-md);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1.2), box-shadow .35s ease;
}

.logo-card:hover {
    transform: translateY(-5px) rotate(-2deg) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.logo-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 28px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(120deg, var(--orange), var(--pink));
    border-radius: 999px;
    padding: .45rem 1rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 10px 20px -12px rgba(255, 95, 143, .9);
}

.eyebrow::before {
    content: "✦";
    font-size: .9rem;
    color: var(--yellow);
}

.hero h1 {
    margin: 0 0 .45rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 5.4vw, 3.5rem);
    letter-spacing: -.02em;
    line-height: 1.05;
    background: linear-gradient(115deg, var(--orange-strong) 0%, var(--pink) 48%, var(--grape) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
}

.hero .lead {
    margin: 0 auto .55rem;
    max-width: 620px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.02rem, 2.2vw, 1.25rem);
    color: var(--teal-strong);
}

.hero .desc {
    margin: 0 auto;
    max-width: 640px;
    font-size: .98rem;
    color: var(--muted);
}

/* --- Tarjeta de búsqueda --- */
.search-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.6rem, 4vw, 2.7rem);
    margin-bottom: 2rem;
    animation: rise .6s .08s ease both;
}

.search-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: linear-gradient(90deg, var(--teal), var(--sky), var(--grape), var(--pink), var(--yellow), var(--orange));
}

.search-head {
    text-align: center;
    margin-bottom: 1.8rem;
}

.search-head h2 {
    margin: 0 0 .3rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    letter-spacing: -.01em;
    color: var(--ink);
}

.search-head p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 1.2rem;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.field label {
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: .01em;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .input-icon {
    position: absolute;
    left: 1rem;
    width: 19px;
    height: 19px;
    color: var(--orange);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--cream);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    padding: .9rem 1rem .9rem 2.9rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-wrap input::placeholder {
    color: #ada8c0;
    font-weight: 500;
}

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

.input-wrap input:focus {
    outline: none;
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 196, 182, .16);
}

.search-form .submit-row {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: .5rem;
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    font-family: var(--font-display);
    font-size: 1.06rem;
    font-weight: 500;
    letter-spacing: .01em;
    color: #fff;
    background: linear-gradient(120deg, var(--orange) 0%, var(--pink) 55%, var(--grape) 120%);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    cursor: pointer;
    box-shadow: 0 16px 30px -14px rgba(255, 95, 143, .75);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1.2), box-shadow .25s ease, filter .2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 22px 38px -16px rgba(255, 95, 143, .8);
    filter: saturate(1.08);
}

.btn-primary:active {
    transform: translateY(0) scale(.99);
}

.btn-primary:disabled {
    cursor: progress;
    filter: grayscale(.12);
    opacity: .92;
    transform: none;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

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

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

.btn-primary.is-loading .btn-icon {
    display: none;
}

.alert-error {
    background: #fff0f3;
    border: 1.5px solid #ffc9d6;
    color: #b3224a;
    border-radius: 14px;
    padding: .8rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
}

.hint {
    margin: .2rem 0 0;
    text-align: center;
    font-size: .8rem;
    color: #a7a1bb;
}

/* --- Resultados --- */
.results {
    display: grid;
    gap: 1.3rem;
    margin-bottom: 2rem;
    scroll-margin-top: 1.5rem;
    animation: rise .5s ease both;
}

.result-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #eefaf8, #ddf6f1);
    border-bottom: 1px solid var(--line);
}

.result-card--box .result-head {
    background: linear-gradient(135deg, #fff3ea, #ffe6d6);
}

.result-head .pill {
    display: inline-block;
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--teal-strong);
    margin-bottom: .15rem;
}

.result-card--box .result-head .pill {
    color: var(--orange-strong);
}

.result-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.result-head .count {
    flex: none;
    min-width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--line);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--teal-strong);
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.result-card--box .result-head .count {
    color: var(--orange-strong);
}

.receipt-list {
    list-style: none;
    margin: 0;
    padding: .4rem 0;
}

.receipt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .95rem 1.5rem;
    transition: background .18s ease;
}

.receipt-row + .receipt-row {
    border-top: 1px dashed var(--line);
}

.receipt-row:hover {
    background: #fbf9ff;
}

.receipt-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
}

.receipt-meta {
    font-size: .85rem;
    color: var(--muted);
    margin-top: .1rem;
}

.download-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-display);
    font-size: .88rem;
    font-weight: 500;
    color: var(--orange-strong);
    text-decoration: none;
    background: #fff1e8;
    border: 2px solid #ffdcc8;
    border-radius: 999px;
    padding: .55rem 1.05rem;
    transition: background .2s ease, color .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1.2), box-shadow .2s ease, border-color .2s ease;
}

.download-btn svg {
    width: 16px;
    height: 16px;
}

.download-btn:hover {
    background: linear-gradient(120deg, var(--orange), var(--pink));
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px -10px rgba(255, 95, 143, .8);
}

.empty-state {
    text-align: center;
    background: var(--white);
    border: 2px dashed #e2dcf2;
    border-radius: var(--radius-xl);
    padding: 2.6rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.empty-state .emoji {
    font-size: 2.2rem;
    display: block;
    margin-bottom: .5rem;
}

.empty-state h3 {
    margin: 0 0 .3rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: .93rem;
}

/* --- Información --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
    margin-bottom: 2rem;
    animation: rise .6s .12s ease both;
}

.info-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #f0fbf9 0%, #e6f7f4 100%);
    border: 1px solid #d6efe9;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.6rem;
    transition: transform .25s ease, box-shadow .25s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.info-card--grape {
    background: linear-gradient(150deg, #f4f1ff 0%, #ebe6ff 100%);
    border-color: #ded5ff;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0 0 .8rem;
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 600;
}

.info-card h3 svg {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 12px;
    background: var(--white);
    color: var(--teal-strong);
    box-shadow: var(--shadow-sm);
    flex: none;
}

.info-card--grape h3 svg {
    color: var(--grape);
}

.info-card p {
    margin: 0 0 .7rem;
    font-size: .94rem;
    color: #5b5570;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card a {
    color: var(--orange-strong);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 107, 53, .3);
    transition: border-color .2s ease;
}

.info-card a:hover {
    border-color: var(--orange-strong);
}

.info-card--grape a {
    color: var(--grape);
    border-bottom-color: rgba(123, 97, 255, .3);
}

.info-card--grape a:hover {
    border-color: var(--grape);
}

.bank-box {
    background: rgba(255, 255, 255, .8);
    border: 1.5px dashed #d9d2ee;
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: #5b5570;
    white-space: pre-line;
}

.bank-data {
    display: grid;
    gap: .5rem;
    margin-top: .6rem;
}

.bank-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .85rem;
}

.bank-row-label {
    flex: 0 0 auto;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--grape);
}

.bank-row-value {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: anywhere;
    user-select: all;
}

.copy-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .55rem;
    border: 1px solid #d9d2ee;
    border-radius: 999px;
    background: rgba(123, 97, 255, .08);
    color: var(--grape);
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}

.copy-btn svg {
    width: 13px;
    height: 13px;
}

.copy-btn:hover {
    background: rgba(123, 97, 255, .16);
    border-color: var(--grape);
}

.copy-btn:active {
    transform: scale(.96);
}

.copy-btn:focus-visible {
    outline: 2px solid var(--grape);
    outline-offset: 2px;
}

.copy-btn.is-copied {
    background: rgba(46, 196, 182, .16);
    border-color: var(--teal);
    color: #177e75;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: .9rem;
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 500;
    color: var(--orange-strong);
    text-decoration: none;
}

.contact-link svg {
    width: 18px;
    height: 18px;
}

.info-card--grape .contact-link {
    color: var(--grape);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 1.5rem 0 2.5rem;
    font-size: .85rem;
    color: #9a94ae;
}

.footer strong {
    color: var(--orange-strong);
}

.footer .heart {
    color: var(--pink);
    display: inline-block;
    animation: beat 1.8s ease-in-out infinite;
}

/* --- Overlay de carga --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 253, 255, .74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
}

.loading-overlay.show {
    visibility: visible;
    opacity: 1;
}

.loading-overlay .spinner-lg {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 6px solid #e5f6f3;
    border-top-color: var(--teal);
    border-right-color: var(--orange);
    animation: spin .8s linear infinite;
}

/* --- Animaciones --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-18px) translateX(10px); }
}

@keyframes beat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    40% { transform: scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* --- Responsive --- */
@media (max-width: 720px) {
    .wrap {
        width: min(100%, 100% - 1.6rem);
        padding-top: 1.6rem;
    }

    .logo-card {
        width: 124px;
        height: 124px;
        border-radius: 30px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .receipt-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .7rem;
        padding: .9rem 1.15rem;
    }

    .download-btn {
        align-self: stretch;
        justify-content: center;
    }

    .result-head {
        padding: 1rem 1.15rem;
    }
}
