/**
 * WC Loyalty Points - Frontend Styles
 *
 * Restyled to use the theme's own design tokens (assets/css/variables.css)
 * directly instead of a separate, disconnected palette, and to follow this
 * project's own button/input rules (see CLAUDE.md): buttons get 6px
 * radius (not pill-shaped), inputs are square (0 radius), and the only
 * hover effect on real buttons is `filter: brightness(0.92)`, gated to
 * `@media (hover: hover) and (pointer: fine)` so nothing sticks after a
 * tap on touch devices. The original stylesheet already matched the
 * brand's actual colors closely (#f95738/#2f2a5e are exact matches for
 * --color-primary-alt/--color-primary) - this keeps that, wired to the
 * real source of truth instead of a hardcoded copy.
 *
 * Every selector below is unchanged from the original - taken directly
 * from the real templates this plugin renders (theme/inc/loyalty-points/templates/),
 * so this only restyles existing markup, it doesn't restructure it.
 */

.wclp-account-wrap,
.wclp-store-wrap,
.wclp-quiz-wrap {
    /* Local aliases for the theme's tokens (assets/css/variables.css) - no
       color literals here, so dark mode and any palette change apply to the
       loyalty pages too. Defined on all three wrapper classes, not just
       .wclp-account-wrap, since the rewards-store page and the standalone
       daily-quiz view are NOT nested inside the account wrapper - a custom
       property defined on the wrong ancestor would simply not exist there. */
    --wclp-red:         var(--color-primary-alt);
    --wclp-red-dark:    var(--color-primary-alt-dark);
    --wclp-red-bg:      var(--color-accent-tint);
    --wclp-purple:      var(--color-primary);
    --wclp-purple-dark: var(--color-primary-dark);
    --wclp-heading:     var(--color-heading);   /* purple TEXT/borders: brand purple in light mode, white in dark (--wclp-purple stays for purple backgrounds) */
    --wclp-text:        var(--color-text);
    --wclp-text-light:  var(--color-text-muted);
    --wclp-muted:       var(--color-text-muted);
    --wclp-border:      var(--color-border);
    --wclp-bg:          var(--color-surface-alt);
    --wclp-bg-gray:     var(--color-surface-alt);
    --wclp-surface:     var(--color-surface);
    --wclp-gold:        var(--color-rating);
    --wclp-radius:      var(--border-radius-lg);        /* 8px - exact match */
    --wclp-radius-lg:   var(--border-radius-xl);        /* 12px - exact match */
    /* Pills (status badges/tags) legitimately stay fully rounded - not
       buttons or inputs, so CLAUDE.md's square-corners rule doesn't apply
       to them. */
    --wclp-radius-pill: var(--border-radius-full);
    /* Real <button> elements use this instead - CLAUDE.md: "border-radius:
       6px - Only buttons have rounded corners". Not --wclp-radius-pill. */
    --wclp-btn-radius:  var(--border-radius-md);
    --wclp-shadow-sm:   var(--shadow-md);
    --wclp-shadow:      var(--shadow-md);
    --wclp-shadow-lg:   var(--shadow-lg);
    --wclp-transition:  0.3s ease;

    width: 100%;
    font-family: var(--font-tertiary);
    color: var(--wclp-text);
    -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ */
/* Balance hero                                                         */
/* ------------------------------------------------------------------ */
.wclp-balance-hero {
    background: linear-gradient(135deg, var(--wclp-purple-dark) 0%, var(--wclp-purple) 100%);
    border-radius: var(--wclp-radius-lg);
    padding: 36px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--wclp-shadow-lg);
}
.wclp-balance-hero::before {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--color-accent-tint-strong);
    pointer-events: none;
}
.wclp-balance-hero::after {
    content: '';
    position: absolute;
    right: 80px;
    bottom: -50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--color-accent-tint);
    pointer-events: none;
}
.wclp-balance-left  { width: 100%; position: relative; z-index: 1; flex: 1; }
.wclp-balance-right { position: relative; z-index: 1; }

.wclp-balance-eyebrow {
    color: var(--color-on-primary-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 10px;
}
.wclp-balance-number {
    font-family: var(--font-primary);
    color: var(--color-white);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.wclp-balance-number .wclp-unit {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-on-primary-muted);
    margin-left: 8px;
}
.wclp-balance-sub {
    color: var(--color-on-primary-muted);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
}
.wclp-balance-icon {
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px var(--color-accent-tint-strong));
}

/* Progress bar */
.wclp-progress-wrap {
    margin-top: 18px;
}
.wclp-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-on-primary-muted);
    margin-bottom: 8px;
    font-weight: 500;
    gap: 10px;
}
.wclp-progress-labels strong {
    color: var(--color-white);
    font-weight: 700;
}
.wclp-progress-track {
    background: var(--color-on-primary-track);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}
.wclp-progress-fill {
    background: linear-gradient(90deg, var(--wclp-red) 0%, var(--color-primary-alt-light) 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
    box-shadow: 0 0 8px var(--color-accent-tint-strong);
}

/* ------------------------------------------------------------------ */
/* Tabs                                                                 */
/* ------------------------------------------------------------------ */
.wclp-section-card--tabs {
    padding: 0;
    overflow: visible; /* allow tab nav to scroll on mobile */
}
.wclp-tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--wclp-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.wclp-tabs-nav::-webkit-scrollbar { display: none; }

.wclp-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--wclp-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--wclp-transition), border-color var(--wclp-transition);
    letter-spacing: 0.01em;
}
/* Text-only hover (no background/transform) - a lingering color change on
   a tap is harmless here, unlike the filled buttons below, so this is
   left ungated. */
.wclp-tab-btn:hover {
    color: var(--wclp-heading);
}
.wclp-tab-btn.wclp-tab-active {
    color: var(--wclp-red);
    border-bottom-color: var(--wclp-red);
}

.wclp-tab-panel {
    display: none;
}
.wclp-tab-panel.wclp-tab-active {
    display: block;
}

/* ------------------------------------------------------------------ */
/* Section cards                                                        */
/* ------------------------------------------------------------------ */
.wclp-section-card {
    background: var(--wclp-surface);
    border: 1px solid var(--wclp-border);
    border-radius: var(--wclp-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--wclp-shadow-sm);
}
.wclp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
}
.wclp-section-title {
    font-family: var(--font-primary);
    font-size: 17px;
    font-weight: 700;
    color: var(--wclp-heading);
    margin: 0;
    letter-spacing: -0.01em;
}
.wclp-section-link {
    font-size: 13px;
    color: var(--wclp-red);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--wclp-transition);
}
.wclp-section-link:hover {
    color: var(--wclp-red-dark);
}
.wclp-section-body {
    padding: 22px 28px 28px;
}
.wclp-section-body--table {
    padding: 0;
}
.wclp-empty-text {
    font-size: 13px;
    color: var(--wclp-muted);
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* CLAUDE.md: buttons get 6px radius (--wclp-btn-radius, not the pill    */
/* token), and their ONLY hover effect is filter: brightness(0.92),      */
/* gated to real mouse/trackpad devices - never a transform, never on    */
/* touch (avoids a "stuck" hover state after a tap).                     */
/* ------------------------------------------------------------------ */
.wclp-cta-btn,
.wclp-copy-btn,
.wclp-copy-code-btn,
.wclp-redeem-btn {
    border-radius: var(--wclp-btn-radius);
    transition: filter 0.15s ease;
}

.wclp-cta-btn {
    display: inline-block;
    background: var(--wclp-red);
    color: var(--color-white);
    border: 2px solid var(--wclp-red);
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.wclp-copy-btn {
    background: var(--wclp-red);
    color: var(--color-white);
    border: 2px solid var(--wclp-red);
    padding: 11px 24px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.wclp-copy-code-btn {
    background: transparent;
    border: 1px solid var(--wclp-border);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--wclp-text-light);
    cursor: pointer;
}
.wclp-copy-code-btn:hover {
    background: var(--wclp-red);
    border-color: var(--wclp-red);
    color: var(--color-white);
}

@media (hover: hover) and (pointer: fine) {
    .wclp-cta-btn:hover,
    .wclp-copy-btn:hover,
    .wclp-redeem-btn.wclp-can-afford:hover {
        filter: brightness(0.92);
    }
    .wclp-copy-code-btn:hover {
        filter: brightness(0.92);
    }
}

/* ------------------------------------------------------------------ */
/* Referral section                                                     */
/* ------------------------------------------------------------------ */

/* Promo banner */
.wclp-referral-promo {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--wclp-red-bg);
    border: 1px solid var(--color-accent-tint-strong);
    border-radius: var(--wclp-radius);
    padding: 18px 22px;
    margin-bottom: 22px;
}
.wclp-referral-promo-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}
.wclp-referral-promo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wclp-referral-promo-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--wclp-heading);
}
.wclp-referral-promo-text span {
    font-size: 13px;
    color: var(--wclp-text-light);
    line-height: 1.55;
}

/* Link block */
.wclp-referral-link-block {
    margin-bottom: 28px;
}
.wclp-referral-link-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--wclp-muted);
    margin-bottom: 10px;
}
.wclp-referral-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
/* Square corners - CLAUDE.md: "NO border-radius on any input fields". */
.wclp-referral-input {
    flex: 1;
    background: var(--wclp-surface);
    border: 1px solid var(--wclp-border);
    border-radius: 0;
    padding: 11px 20px;
    font-size: 13px;
    color: var(--wclp-text);
    font-family: inherit;
    font-weight: 500;
    transition: border-color var(--wclp-transition);
    outline: none;
    min-width: 0;
}
.wclp-referral-input:focus {
    border-color: var(--wclp-heading);
}

/* Referrals list */
.wclp-referrals-list-wrap {
    border-top: 1px solid var(--wclp-border);
    padding-top: 22px;
}
.wclp-referrals-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--wclp-text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.wclp-referral-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wclp-red);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 1;
}

/* Empty state */
.wclp-referral-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--wclp-bg);
    border-radius: var(--wclp-radius);
    padding: 18px 20px;
    border: 1px dashed var(--wclp-border);
}
.wclp-referral-empty-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.wclp-referral-empty p {
    font-size: 13px;
    color: var(--wclp-muted);
    margin: 0;
    line-height: 1.5;
}

/* Referral users list */
.wclp-referral-users {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wclp-referral-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-gray-lighter);
}
.wclp-referral-user:last-child {
    border-bottom: none;
}
.wclp-referral-user-avatar .wclp-avatar {
    border-radius: 50%;
    display: block;
}
.wclp-referral-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.wclp-referral-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wclp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wclp-referral-user-date {
    font-size: 12px;
    color: var(--wclp-muted);
}
.wclp-referral-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--wclp-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.wclp-referral-rewarded {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}
.wclp-referral-pending {
    background: var(--color-notice-bg);
    color: var(--color-notice-text);
}

/* ------------------------------------------------------------------ */
/* History table                                                        */
/* ------------------------------------------------------------------ */
.wclp-account-wrap .wclp-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.wclp-account-wrap .wclp-history-table thead tr {
    background: var(--wclp-bg);
    border-bottom: 2px solid var(--wclp-border);
}
.wclp-account-wrap .wclp-history-table thead th {
    text-align: left;
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--wclp-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--wclp-bg);
    border: none;
}
.wclp-account-wrap .wclp-history-table thead th:last-child {
    text-align: right;
}
.wclp-account-wrap .wclp-history-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-gray-lighter);
    border-top: none;
    color: var(--wclp-text);
    vertical-align: middle;
    font-weight: 400;
}
.wclp-account-wrap .wclp-history-table tbody tr:hover td {
    background-color: var(--wclp-bg);
}
.wclp-account-wrap .wclp-history-table tbody tr:last-child td {
    border-bottom: none;
}
.wclp-account-wrap .wclp-history-date {
    color: var(--wclp-muted);
    font-size: 13px;
    white-space: nowrap;
}
.wclp-account-wrap .wclp-history-note {
    font-size: 13px;
    color: var(--wclp-text-light);
    max-width: 340px;
}
.wclp-account-wrap .wclp-pts-pos {
    color: var(--color-success-text);
    font-weight: 700;
    font-size: 15px;
    text-align: right;
}
.wclp-account-wrap .wclp-pts-neg {
    color: var(--color-error-text);
    font-weight: 700;
    font-size: 15px;
    text-align: right;
}

/* Type pills */
.wclp-type-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--wclp-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wclp-pill-purchase         { background: var(--color-success-bg); color: var(--color-success-text); }
.wclp-pill-redemption       { background: var(--color-notice-bg); color: var(--color-notice-text); }
.wclp-pill-registration     { background: var(--color-primary-tint-strong); color: var(--color-heading); }
.wclp-pill-referral         { background: var(--color-accent-tint); color: var(--color-primary-alt-dark); }
.wclp-pill-admin_adjustment { background: var(--color-surface-alt); color: var(--color-text-muted); }
.wclp-pill-quiz             { background: var(--color-info-bg); color: var(--color-info-text); }

/* ------------------------------------------------------------------ */
/* Rewards grid                                                         */
/* ------------------------------------------------------------------ */
.wclp-rewards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 0;
}

.wclp-reward-card {
    border: 1px solid var(--wclp-border);
    border-radius: var(--wclp-radius);
    padding: 22px 18px 20px;
    text-align: center;
    background: var(--wclp-surface);
    box-shadow: var(--wclp-shadow-sm);
    transition: box-shadow var(--wclp-transition);
    position: relative;
}
/* No lift/transform on card hover - CLAUDE.md: "No animations beyond the
   hover filter" - only the shadow grows, and only on hover-capable
   devices, to avoid a stuck "hovered" card on touch. */
@media (hover: hover) and (pointer: fine) {
    .wclp-reward-card:hover {
        box-shadow: var(--wclp-shadow);
    }
    .wclp-reward-card.wclp-affordable:hover {
        box-shadow: 0 0 0 2px var(--wclp-red), var(--wclp-shadow);
    }
}
.wclp-reward-card.wclp-affordable {
    border-color: var(--wclp-red);
    box-shadow: 0 0 0 1px var(--wclp-red), var(--wclp-shadow-sm);
}
.wclp-reward-card.wclp-locked {
    opacity: 0.65;
    background: var(--wclp-bg);
}

/* Badge — absolute top-left like product site */
.wclp-reward-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--wclp-red);
    color: var(--color-white);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: var(--wclp-radius-pill);
}
.wclp-locked .wclp-reward-badge {
    background: var(--color-neutral);
}

/* Reward image */
.wclp-reward-image {
    margin: 10px -1px 14px;
    overflow: hidden;
    border-radius: var(--wclp-radius) var(--wclp-radius) 0 0;
    line-height: 0;
}
.wclp-reward-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.wclp-locked .wclp-reward-img {
    filter: grayscale(40%);
}

.wclp-reward-name {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 700;
    color: var(--wclp-heading);
    margin: 28px 0 8px;
    line-height: 1.35;
}
.wclp-reward-discount {
    font-size: 22px;
    font-weight: 700;
    color: var(--wclp-red);
    margin: 0 0 12px;
}
.wclp-reward-desc {
    font-size: 12px;
    color: var(--wclp-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}
.wclp-reward-cost {
    margin-bottom: 16px;
}
.wclp-cost-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 700;
    color: var(--wclp-muted);
}
.wclp-affordable .wclp-cost-pill {
    color: var(--wclp-heading);
}

.wclp-redeem-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    letter-spacing: 0.01em;
}
.wclp-redeem-btn.wclp-can-afford {
    background: var(--wclp-red);
    border-color: var(--wclp-red);
    color: var(--color-white);
}
.wclp-redeem-btn.wclp-cannot-afford {
    background: var(--color-surface-alt);
    color: var(--color-text-disabled);
    cursor: not-allowed;
}
.wclp-need-more {
    font-size: 12px;
    color: var(--wclp-muted);
    margin-top: 10px;
    font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* My Coupons list                                                      */
/* ------------------------------------------------------------------ */
.wclp-coupons-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wclp-coupon-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-gray-lighter);
}
.wclp-coupon-row:last-child { border-bottom: none; }

.wclp-coupon-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}
.wclp-coupon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.wclp-coupon-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wclp-text);
}
.wclp-coupon-meta {
    font-size: 12px;
    color: var(--wclp-muted);
}

.wclp-coupon-code-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.wclp-coupon-code {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: var(--wclp-bg);
    border: 1px dashed var(--wclp-border);
    padding: 5px 10px;
    border-radius: var(--wclp-radius);
    color: var(--wclp-heading);
}
.wclp-coupon-active .wclp-coupon-code {
    border-color: var(--wclp-red);
    background: var(--wclp-red-bg);
    color: var(--wclp-red-dark);
}

.wclp-coupon-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--wclp-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.wclp-coupon-badge-active  { background: var(--color-success-bg); color: var(--color-success-text); }
.wclp-coupon-badge-used    { background: var(--color-gray-lighter); color: var(--color-text-muted); }
.wclp-coupon-badge-expired { background: var(--color-notice-bg); color: var(--color-notice-text); }
.wclp-coupon-badge-unknown { background: var(--color-gray-lighter); color: var(--color-text-disabled); }

/* Dim used/expired rows */
.wclp-coupon-used,
.wclp-coupon-expired { opacity: 0.6; }

@media (max-width: 768px) {
    .wclp-coupon-row { flex-wrap: wrap; gap: 10px; }
    .wclp-coupon-code-wrap { width: 100%; }
    .wclp-coupon-code { flex: 1; }
}

/* ------------------------------------------------------------------ */
/* Rewards store page                                                   */
/* ------------------------------------------------------------------ */
.wclp-store-header {
    margin-bottom: 28px;
}
.wclp-store-header h2 {
    font-family: var(--font-primary);
    font-size: 28px;
    font-weight: 700;
    color: var(--wclp-heading);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.wclp-store-balance {
    font-size: 14px;
    color: var(--wclp-muted);
    margin: 0;
}
.wclp-store-balance strong {
    color: var(--wclp-red);
    font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Daily quiz                                                           */
/* ------------------------------------------------------------------ */
.wclp-quiz-header {
    background: linear-gradient(135deg, var(--wclp-purple-dark) 0%, var(--wclp-purple) 100%);
    border-radius: var(--wclp-radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    color: var(--color-white);
}
.wclp-quiz-title {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-white);
    margin: 0 0 4px;
}
.wclp-quiz-date {
    font-size: 13px;
    color: var(--color-on-primary-muted);
    margin: 0 0 10px;
}
.wclp-quiz-subtitle {
    font-size: 15px;
    color: var(--wclp-heading);
    margin: 0 0 16px;
}
.wclp-quiz-points-breakdown {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--color-on-primary-muted);
    font-weight: 500;
}

.wclp-quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wclp-quiz-question-card {
    background: var(--wclp-surface);
    border: 1px solid var(--wclp-border);
    border-radius: var(--wclp-radius-lg);
    padding: 24px 24px 20px;
    box-shadow: var(--wclp-shadow-sm);
    position: relative;
}
.wclp-quiz-question-card.wclp-quiz-q-correct {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}
.wclp-quiz-question-card.wclp-quiz-q-wrong {
    border-color: var(--color-error);
    background: var(--color-error-bg);
}
.wclp-quiz-q-num {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wclp-muted);
    margin-bottom: 8px;
}
.wclp-quiz-q-text {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    color: var(--wclp-heading);
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Options */
.wclp-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}
.wclp-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--wclp-border);
    border-radius: var(--wclp-radius);
    background: var(--wclp-bg);
    transition: border-color 0.2s, background 0.2s;
}
.wclp-quiz-option-radio {
    cursor: pointer;
}
.wclp-quiz-option-radio:hover {
    border-color: var(--wclp-heading);
    background: var(--color-primary-tint);
}
.wclp-radio-input { display: none; }
.wclp-quiz-option-radio:has(.wclp-radio-input:checked) {
    border-color: var(--wclp-heading);
    background: var(--color-primary-tint-strong);
}
.wclp-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wclp-surface);
    border: 1.5px solid var(--wclp-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--wclp-heading);
    flex-shrink: 0;
}
.wclp-opt-text {
    font-size: 14px;
    color: var(--wclp-text);
    flex: 1;
}
.wclp-opt-yours {
    font-size: 11px;
    color: var(--wclp-muted);
    font-style: italic;
    margin-left: 4px;
}
.wclp-opt-tick {
    font-size: 16px;
    color: var(--color-success-text);
    flex-shrink: 0;
    font-weight: 700;
}
/* Result option states */
.wclp-quiz-option.wclp-opt-correct {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}
.wclp-quiz-option.wclp-opt-correct .wclp-opt-letter {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--color-white);
}
.wclp-quiz-option.wclp-opt-wrong {
    border-color: var(--color-error);
    background: var(--color-error-bg);
    opacity: 0.9;
}
.wclp-quiz-option.wclp-opt-wrong .wclp-opt-letter {
    background: var(--color-error);
    border-color: var(--color-error);
    color: var(--color-white);
}

/* Open answer */
.wclp-quiz-open-wrap {
    margin-bottom: 4px;
}
/* Square corners - CLAUDE.md: "NO border-radius on any input fields". */
.wclp-open-answer {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--wclp-border);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--wclp-text);
    background: var(--wclp-bg);
    transition: border-color 0.2s;
    box-sizing: border-box;
    outline: none;
}
.wclp-open-answer:focus {
    border-color: var(--wclp-heading);
    background: var(--wclp-surface);
}
.wclp-quiz-open-result {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}
.wclp-open-label { color: var(--wclp-muted); }
.wclp-open-correct { color: var(--color-success-text); font-weight: 600; margin-left: 6px; }

/* Verdict badge */
.wclp-quiz-q-verdict {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 12px;
    border-radius: var(--wclp-radius-pill);
}
.wclp-verdict-correct { background: var(--color-success-bg); color: var(--color-success-text); }
.wclp-verdict-wrong   { background: var(--color-error-bg); color: var(--color-error-text); }

/* Submit row */
.wclp-quiz-submit-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.wclp-quiz-submit-btn {
    min-width: 160px;
}
.wclp-quiz-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.wclp-quiz-submit-note {
    font-size: 12px;
    color: var(--wclp-muted);
    margin: 0;
}

/* Result summary */
.wclp-quiz-result-summary {
    background: var(--wclp-bg);
    border: 1px solid var(--wclp-border);
    border-radius: var(--wclp-radius-lg);
    padding: 24px 28px;
    text-align: center;
    margin-bottom: 24px;
}
.wclp-quiz-perfect {
    background: linear-gradient(135deg, var(--color-notice-bg) 0%, var(--color-notice-bg) 100%);
    border-color: var(--wclp-gold);
}
.wclp-quiz-result-score {
    font-family: var(--font-primary);
    font-size: 28px;
    font-weight: 700;
    color: var(--wclp-heading);
    margin: 0 0 6px;
}
.wclp-quiz-result-points {
    font-size: 16px;
    color: var(--wclp-red);
    font-weight: 700;
    margin: 0;
}

.wclp-quiz-notice {
    padding: 18px;
    background: var(--wclp-bg);
    border-radius: var(--wclp-radius);
    border: 1px dashed var(--wclp-border);
    color: var(--wclp-muted);
    font-size: 14px;
    text-align: center;
}
.wclp-quiz-login { font-size: 14px; color: var(--wclp-muted); }

@media (max-width: 640px) {
    .wclp-quiz-header { padding: 20px; }
    .wclp-quiz-question-card { padding: 18px 16px 16px; }
    .wclp-quiz-points-breakdown { gap: 12px; }
}

/* ------------------------------------------------------------------ */
/* Product-page points notice                                           */
/* ------------------------------------------------------------------ */
.wclp-product-points {
    font-size: 13px;
    color: var(--wclp-text-light);
    margin: 0.5rem 0;
    padding: 8px 14px;
    background: var(--wclp-red-bg);
    border-left: 3px solid var(--wclp-red);
    border-radius: 0 var(--wclp-radius) var(--wclp-radius) 0;
}
.wclp-product-points strong { color: var(--wclp-red); }

.wclp-balance {
    font-weight: 700;
    color: var(--wclp-red);
}

/* ------------------------------------------------------------------ */
/* Redemption modal                                                     */
/* ------------------------------------------------------------------ */
.wclp-modal {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: var(--z-index-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wclp-modal-inner {
    background: var(--wclp-surface);
    border-radius: var(--wclp-radius-lg);
    padding: 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--wclp-shadow-lg);
}
.wclp-modal-inner p {
    margin-bottom: 18px;
    font-size: 15px;
    color: var(--wclp-text);
    line-height: 1.6;
}
#wclp-coupon-wrap { margin-bottom: 16px; }
/* Square corners - this is an <input>, not a button. */
#wclp-coupon-code {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
    border: 2px dashed var(--wclp-red);
    padding: 0.5rem;
    background: var(--wclp-red-bg);
    color: var(--wclp-heading);
    border-radius: 0;
    outline: none;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .wclp-balance-hero {
        padding: 26px 22px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .wclp-balance-number { font-size: 36px; }
    .wclp-balance-icon {
        font-size: 44px;
        align-self: flex-end;
        margin-top: -8px;
    }
    .wclp-progress-wrap { max-width: 100%; }

    .wclp-section-head {
        padding: 18px 20px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .wclp-section-body { padding: 18px 10px 22px; }
    .wclp-section-title { font-size: 16px; }
    .wclp-section-card--tabs { overflow: hidden; } /* tabs wrap on mobile — no scroll needed, safe to clip */
    .wclp-tabs-nav { border-radius: 0; overflow: hidden; flex-wrap: wrap; }
    .wclp-tab-btn { flex: 0 0 50%; padding: 13px 8px; font-size: 13px; text-align: center; box-sizing: border-box; }
    .wclp-tab-btn:nth-child(1),
    .wclp-tab-btn:nth-child(2) { border-bottom: 1px solid var(--wclp-border); }

    /* History: table → cards on mobile */
    .wclp-account-wrap .wclp-tab-panel { overflow: hidden; }
    .wclp-account-wrap .wclp-history-table { width: 100%; }
    .wclp-account-wrap .wclp-history-table thead { display: none; }
    .wclp-account-wrap .wclp-history-table tbody tr {
        display: block;
        border: 1px solid var(--wclp-border);
        border-radius: var(--wclp-radius);
        margin: 12px 0;
        padding: 4px 0;
        box-shadow: var(--wclp-shadow-sm);
        overflow: hidden;
    }
    .wclp-account-wrap .wclp-history-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 8px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--color-gray-lighter);
        border-top: none;
        font-size: 13px;
        max-width: none;
        box-sizing: border-box;
        width: 100%;
    }
    .wclp-account-wrap .wclp-history-table tbody td:last-child { border-bottom: none; }
    .wclp-account-wrap .wclp-history-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--wclp-muted);
        flex-shrink: 0;
        white-space: nowrap;
    }
    .wclp-account-wrap .wclp-history-table tbody td > * {
        min-width: 0;
        word-break: break-word;
        text-align: right;
    }
    .wclp-history-note { display: flex; } /* override the previous display:none */

    .wclp-rewards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wclp-referral-input-row {
        flex-direction: column;
        gap: 10px;
    }
    .wclp-copy-btn { width: 100%; padding: 13px 24px; }
    .wclp-cta-btn { width: 100%; text-align: center; }

    .wclp-referral-promo { flex-direction: column; gap: 12px; }

    .wclp-history-table { font-size: 13px; }
    .wclp-history-table thead th { padding: 12px 12px; font-size: 10px; }
    .wclp-history-table tbody td { padding: 12px 12px; }
    .wclp-history-note { display: none; } /* hide description on mobile, keep it clean */
    .wclp-history-date,
    .wclp-pts-pos,
    .wclp-pts-neg { font-size: 13px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wclp-rewards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small status badge next to a tab label ("Dnevni kviz": done / new) */
.wclp-tab-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}
.wclp-tab-badge--done { color: var(--color-success-text); background: var(--color-success-bg); }
.wclp-tab-badge--new  { color: var(--color-primary-alt); background: var(--color-accent-tint); }
