/* A template or popup can supply the shortcode outside the article. */
body:has(.ppph-voucher--assigned) .ppph-voucher.ppph-voucher--automatic {
    display: none;
}

.ppph-voucher {
    box-sizing: border-box;
    width: 100%;
    max-width: 320px;
    margin: 20px auto;
    padding: 23px clamp(14px, 5vw, 20px) 35px;
    border-radius: 16px;
    background: #fff;
    color: #1a2532;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
    text-align: center;
    font-family: "Segoe UI", system-ui, sans-serif;
}

.ppph-voucher .ppph-voucher-title {
    margin: 0 0 8px;
    color: #0063a5;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}

.ppph-voucher .ppph-voucher-description {
    margin: 0 0 18px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.ppph-voucher .ppph-voucher-claim {
    display: inline-block;
    box-sizing: border-box;
    width: min(100%, 250px);
    min-height: 66px;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff3100, #ff9c50);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    font: 600 18px / 1.35 "Segoe UI", system-ui, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease, border-radius .3s ease;
}

@media (hover: hover) {
    .ppph-voucher .ppph-voucher-claim[aria-expanded="false"]:not(.is-counting):hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
    }
}

.ppph-voucher .ppph-voucher-claim.is-counting {
    width: 100%;
    border-radius: 10px;
    background: linear-gradient(135deg, #43cea2, #185a9d);
    animation: ppph-voucher-pulse 1.5s infinite;
    cursor: wait;
}

@keyframes ppph-voucher-pulse {
    0% { box-shadow: 0 0 0 0 rgba(24, 90, 157, .4); }
    70% { box-shadow: 0 0 0 15px rgba(24, 90, 157, 0); }
    100% { box-shadow: 0 0 0 0 rgba(24, 90, 157, 0); }
}

.ppph-voucher .ppph-voucher-claim[aria-expanded="true"] {
    background: linear-gradient(135deg, #0065bf, #0078f3);
    cursor: default;
}

.ppph-voucher button:focus-visible {
    outline: 2px solid #075c9d;
    outline-offset: 3px;
}

.ppph-voucher .ppph-voucher-progress {
    height: 6px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 50px;
    background: #eee;
}

.ppph-voucher-progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    transition: width 1s linear;
}

.ppph-voucher .ppph-voucher-result {
    margin-top: 16px;
}

.ppph-voucher [hidden] {
    display: none !important;
}

.ppph-voucher .ppph-voucher-before {
    margin: 0 0 8px;
    color: #526070;
    font-size: 14px;
}

.ppph-voucher .ppph-voucher-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ppph-voucher .ppph-voucher-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 8px 7px 10px;
    border: 1px solid #e6edf4;
    border-radius: 9px;
    background: #f6f9fc;
    list-style: none;
    text-align: left;
}

.ppph-voucher .ppph-voucher-label {
    flex: none;
    color: #526070;
    font-size: 12px;
    font-weight: 700;
}

.ppph-voucher .ppph-voucher-code {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: #12436b;
    font: 700 16px / 1.4 ui-monospace, Consolas, monospace;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ppph-voucher .ppph-voucher-actions {
    flex: none;
    display: grid;
    grid-template-columns: 36px 15px;
    gap: 4px;
    align-items: center;
}

.ppph-voucher .ppph-voucher-copy {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 36px;
    min-width: 0;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #d0deeb;
    border-radius: 7px;
    background: #fff;
    color: #12558c;
    cursor: pointer;
}

.ppph-voucher .ppph-voucher-copy:hover {
    background: #eaf3fc;
}

.ppph-voucher .ppph-voucher-copy-icon {
    position: relative;
    width: 16px;
    height: 17px;
}

.ppph-voucher-copy-icon::before,
.ppph-voucher-copy-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
    width: 11px;
    height: 13px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.ppph-voucher-copy-icon::before {
    top: 0;
    left: 0;
}

.ppph-voucher-copy-icon::after {
    right: 0;
    bottom: 0;
    background: #fff;
}

.ppph-voucher-copy-check {
    color: #187541;
    font: 700 17px / 1 "Segoe UI", system-ui, sans-serif;
    text-align: center;
}

.ppph-voucher .ppph-voucher-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
    .ppph-voucher .ppph-voucher-claim,
    .ppph-voucher-progress > span {
        transition: none;
    }

    .ppph-voucher .ppph-voucher-claim.is-counting {
        animation: none;
    }

    .ppph-voucher .ppph-voucher-claim[aria-expanded="false"]:not(.is-counting):hover {
        transform: none;
    }
}
