/*
 * Affiliate program page — self-contained, pure CSS.
 *
 * Matches the profacefinder.com design system: the Twenty Twenty-Four theme,
 * Roboto type, a white / #F9F9F9 canvas, dark #222 text and the brand blue
 * #1E7EF2 as the single accent. Light and clean, not "techy".
 *
 * The plugin loads Bootstrap and the Tailwind CDN site-wide, both of which
 * reset and restyle base elements, so every rule is scoped under `.pff` and
 * every property the layout leans on is set explicitly rather than inherited.
 */

.pff {
    --brand: #1e7ef2;
    --brand-dark: #1667d6;
    --brand-soft: #eaf2fe;
    --brand-line: #cfe0fb;

    --ink: #1a2230;
    --ink-soft: #5a6472;
    --ink-faint: #98a1b0;

    --bg: #ffffff;
    --bg-soft: #f7f9fc;
    --line: #e4e8ee;
    --line-strong: #d5dbe4;

    --ok: #1e9e6a;

    --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --radius: 14px;
    --radius-sm: 10px;

    box-sizing: border-box;
    display: block;
    width: 100%;
    /* The root carries .alignwide: the theme grows it to the wide-size and
       centres it with `margin: auto !important`, so the section sits dead
       centre. A soft rounded band makes the white cards read cleanly. */
    margin-top: 0;
    margin-bottom: 0;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2.75rem);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 24px;
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-align: left;
}

/* Hard reset so Bootstrap / Tailwind base rules cannot leak in. */
.pff *,
.pff *::before,
.pff *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    line-height: inherit;
    color: inherit;
    letter-spacing: normal;
    text-transform: none;
    text-align: inherit;
    list-style: none;
    box-shadow: none;
    float: none;
}

.pff__shell {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

/* ---------- two-column top (form left, rewards right) ---------- */

.pff__top {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.75rem);
    align-items: start;
}

.pff__lead { min-width: 0; }

.pff__aside {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.pff__card {
    padding: clamp(1.35rem, 2.5vw, 1.75rem);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pff__card-title {
    margin-bottom: 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.pff__perks {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.pff__perk {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.pff__perk strong { color: var(--ink); font-weight: 600; }

.pff__perk-mark {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--brand-soft);
}

/* Pure-CSS checkmark, no icon font or SVG needed. */
.pff__perk-mark::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    width: 5px;
    height: 9px;
    border: solid var(--brand);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pff__card--quiet {
    background: var(--brand-soft);
    border-color: var(--brand-line);
}

.pff__reward-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
}

.pff__reward-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

.pff__reward-sub {
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.pff__reward-sub strong { color: var(--brand-dark); font-weight: 600; }

/* ---------- ready-to-share messages ---------- */

.pff__share { margin-top: clamp(1.75rem, 4vw, 2.75rem); }

.pff__share-title {
    margin-bottom: 0.4rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.pff__share-lede {
    margin-bottom: 1.1rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.pff__share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.pff__share-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.pff__share-text {
    flex: 1 1 auto;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

.pff__share-link {
    display: inline;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--brand-dark);
    word-break: break-all;
}

.pff__share-copy {
    align-self: flex-start;
    padding: 0.55rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pff__share-copy:hover { background: var(--bg-soft); border-color: var(--brand); color: var(--brand-dark); }
.pff__share-copy:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pff__share-copy.is-copied { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }

.pff__share-note {
    margin-top: 1rem;
    font-size: 0.88rem;
    color: var(--ink-soft);
}
.pff__share-note strong { color: var(--ink); font-weight: 600; }

/* ---------- FAQ ---------- */

.pff__faq { margin-top: clamp(1.75rem, 4vw, 2.75rem); }

.pff__faq-title {
    margin-bottom: 1.1rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.pff__faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.pff__faq-item {
    padding: 1.15rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.pff__faq-item h3 {
    margin-bottom: 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
}

.pff__faq-item p {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* ---------- hero ---------- */

.pff__hero {
    margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
}

.pff__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    background: var(--brand-soft);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.pff__eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
}

.pff__title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--ink);
}

.pff__lede {
    max-width: 46rem;
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--ink-soft);
}

/* ---------- the request frame ---------- */

.pff__frame {
    position: relative;
    padding: clamp(1.35rem, 3vw, 2rem);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(20, 34, 60, 0.04), 0 10px 30px -20px rgba(20, 34, 60, 0.25);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.pff__frame[data-state="found"] {
    border-color: var(--brand-line);
}

/* Subtle corner brackets — a quiet nod to the detection UI, not a light show. */
.pff__bracket {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--brand);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.pff__bracket--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 5px; }
.pff__bracket--tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 5px; }
.pff__bracket--bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 5px; }
.pff__bracket--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 5px; }

.pff__frame[data-state="scanning"] .pff__bracket,
.pff__frame[data-state="found"] .pff__bracket { opacity: 0.8; }
.pff__frame[data-state="scanning"] .pff__bracket { transform: scale(1.05); }

.pff__scan {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(30, 126, 242, 0.08), transparent);
}

.pff__frame[data-state="scanning"] .pff__scan {
    opacity: 1;
    animation: pff-sweep 1s linear infinite;
}

@keyframes pff-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ---------- fields ---------- */

.pff__label,
.pff__tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.pff__tag { color: var(--brand-dark); }

.pff__tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}

.pff__field {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pff__input {
    flex: 1 1 18rem;
    min-width: 0;
    width: 100%;
    height: auto;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pff__input::placeholder { color: var(--ink-faint); opacity: 1; }

.pff__input:focus,
.pff__input:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.pff__input--link {
    font-family: var(--mono);
    font-size: 0.9rem;
    background: var(--bg-soft);
    color: var(--brand-dark);
}

.pff__go {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pff__go:hover { background: var(--brand-dark); }
.pff__go:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.pff__go--copy {
    background: var(--bg);
    border: 1px solid var(--line-strong);
    color: var(--ink);
}
.pff__go--copy:hover { background: var(--bg-soft); border-color: var(--brand); color: var(--brand-dark); }

/* Busy state: swap label for a spinner, driven by the aria-busy attribute. */
.pff__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pff-spin 0.7s linear infinite;
}

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

.pff__go[aria-busy="true"] { pointer-events: none; opacity: 0.9; }
.pff__go[aria-busy="true"] .pff__go-label { display: none; }
.pff__go[aria-busy="true"] .pff__spinner { display: inline-block; }

/* Honeypot: hidden from people, still filled in by bots. */
.pff__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.pff__error {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #d64545;
}
.pff__error:empty { margin-top: 0; }

.pff__hint {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--ink-faint);
}

.pff__meta {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.pff__meta span { font-weight: 600; color: var(--ink); }

.pff__text-btn {
    display: inline;
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.pff__text-btn:hover { color: var(--brand-dark); }

/* ---------- readout ---------- */

.pff__readout { margin-top: 1.25rem; }

.pff__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0;
}

.pff__stat {
    padding: 1.25rem 1.15rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.pff__stat dt {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.pff__stat dd {
    margin-top: 0.4rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pff__stat--signal {
    background: var(--brand-soft);
    border-color: var(--brand-line);
}
.pff__stat--signal dd { color: var(--brand-dark); }

/* ---------- credits ---------- */

.pff__credits {
    margin-top: 0.75rem;
    padding: clamp(1.25rem, 3vw, 1.65rem);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pff__h2 {
    margin-bottom: 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.pff__empty,
.pff__note {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.pff__note { margin-top: 1rem; color: var(--ink-faint); }

.pff__list { margin: 0; }

.pff__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
}

.pff__item:first-child { border-top: 0; }

.pff__item-code {
    flex: 1 1 auto;
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: var(--ink);
}

.pff__item-date {
    font-size: 0.8rem;
    color: var(--ink-faint);
    white-space: nowrap;
}

.pff__item-state {
    flex: 0 0 auto;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pff__item-state--ready {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand-line);
}

.pff__item-state--used {
    background: var(--bg-soft);
    color: var(--ink-faint);
    border: 1px solid var(--line);
}

/* A credit that just landed announces itself once. */
.pff__item--new { animation: pff-land 0.5s ease-out; }

@keyframes pff-land {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- steps ---------- */

.pff__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.pff__step {
    padding: 1.35rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.pff__step-n {
    display: inline-block;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand);
}

.pff__step-title {
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.pff__step-text {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 52rem) {
    .pff__top { grid-template-columns: 1fr; }
}

@media (max-width: 48rem) {
    .pff__share-grid { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
    .pff__steps { grid-template-columns: 1fr; }
    .pff__faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 34rem) {
    .pff__stats { grid-template-columns: 1fr; }
    .pff__go { flex: 1 1 100%; }

    .pff__item {
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
    }
    .pff__item-code { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pff *,
    .pff *::before,
    .pff *::after {
        animation: none !important;
        transition: none !important;
    }
}
