/* =========================================================
   Wupex Gift Cards — Reveal Page (Frontend)
   ========================================================= */

:root {
    --wupex-primary:      var(--wp--preset--color--primary, #7c3aed);
    --wupex-primary-dark: #6d28d9;
    --wupex-success:      #059669;
    --wupex-surface:      #ffffff;
    --wupex-text:         #111827;
    --wupex-muted:        #6b7280;
    --wupex-border:       #e5e7eb;
    --wupex-bg-subtle:    #f9fafb;
    --wupex-radius:       14px;
    --wupex-shadow:       0 8px 48px rgba(0, 0, 0, .13);
}

@keyframes wupex-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Page wrapper ---- */
.wupex-reveal-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px 72px;
}

/* ---- Card ---- */
.wupex-reveal-card {
    background: var(--wupex-surface);
    border-radius: var(--wupex-radius);
    box-shadow: var(--wupex-shadow);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    animation: wupex-fadein .38s ease both;
}

/* ---- Desktop: two-column layout ---- */
@media (min-width: 760px) {
    .wupex-reveal-card {
        display: grid;
        grid-template-columns: 300px 1fr;
        max-width: 860px;
    }

    .wupex-reveal-header {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 48px 36px;
        /* gradient runs top-to-bottom on the left panel */
        background: linear-gradient(180deg, var(--wupex-primary) 0%, var(--wupex-primary-dark) 100%);
    }

    .wupex-reveal-body {
        padding: 40px 40px 36px;
    }

    .wupex-product-name {
        text-align: left;
    }

    .wupex-reveal-note {
        text-align: left;
    }
}

/* ---- Header band ---- */
.wupex-reveal-header {
    background: linear-gradient(135deg, var(--wupex-primary) 0%, var(--wupex-primary-dark) 100%);
    padding: 36px 28px 30px;
    text-align: center;
    color: #fff;
}

.wupex-reveal-icon {
    font-size: 52px;
    line-height: 1;
    display: block;
    margin-bottom: 14px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25));
}

.wupex-reveal-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.wupex-reveal-tagline {
    font-size: 14px;
    color: rgba(255, 255, 255, .82);
    margin: 0;
    font-weight: 400;
}

/* ---- Body ---- */
.wupex-reveal-body {
    padding: 30px 28px 26px;
}

/* Product label */
.wupex-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--wupex-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 20px;
}

/* Code display box */
.wupex-code-wrap {
    background: var(--wupex-bg-subtle);
    border: 2px solid var(--wupex-primary);
    border-radius: 10px;
    padding: 22px 20px 16px;
    margin-bottom: 14px;
    text-align: center;
}

.wupex-code-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wupex-muted);
    margin-bottom: 12px;
}

.wupex-pin {
    display: block;
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--wupex-text);
    word-break: break-all;
    line-height: 1.35;
    user-select: all;
    -webkit-user-select: all;
}

.wupex-serial-number {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--wupex-muted);
    margin-top: 10px;
    letter-spacing: .04em;
}

/* Copy button — full width, below the code */
.wupex-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--wupex-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .18s ease, transform .12s ease;
    margin-bottom: 24px;
    font-family: inherit;
}

.wupex-copy-btn:hover {
    background: var(--wupex-primary-dark);
}

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

.wupex-copy-btn.wupex-copied {
    background: var(--wupex-success);
}

.wupex-copy-btn svg {
    flex-shrink: 0;
    transition: opacity .15s;
}

/* ---- Details grid ---- */
.wupex-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.wupex-detail-item {
    background: var(--wupex-bg-subtle);
    border-radius: 8px;
    padding: 13px 14px;
}

.wupex-detail-item.wupex-detail-full {
    grid-column: 1 / -1;
}

.wupex-detail-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wupex-muted);
    margin-bottom: 4px;
}

.wupex-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--wupex-text);
    word-break: break-word;
}

/* ---- Footer note ---- */
.wupex-reveal-note {
    font-size: 12px;
    color: var(--wupex-muted);
    text-align: center;
    border-top: 1px solid var(--wupex-border);
    padding-top: 18px;
    margin: 0;
    line-height: 1.65;
}

/* ---- Error state ---- */
.wupex-reveal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 32px 28px;
    color: #991b1b;
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    animation: wupex-fadein .35s ease both;
}

.wupex-reveal-error p {
    margin: 0 0 12px;
}

.wupex-reveal-error p:last-child {
    margin-bottom: 0;
}

.wupex-reveal-error a {
    color: #991b1b;
    font-weight: 600;
}

/* ---- Mobile ---- */
@media (max-width: 540px) {
    .wupex-reveal-page {
        padding: 20px 12px 56px;
    }

    .wupex-reveal-header {
        padding: 28px 20px 24px;
    }

    .wupex-reveal-icon {
        font-size: 42px;
    }

    .wupex-reveal-body {
        padding: 22px 18px 20px;
    }

    .wupex-pin {
        font-size: 22px;
        letter-spacing: .12em;
    }

    .wupex-details-grid {
        grid-template-columns: 1fr;
    }
}
