/*
 * WDT Rejestracje — frontend
 *
 * Kolory stanów są zebrane w jednym miejscu. Zmiana palety success/error
 * nie wymaga edycji poszczególnych komponentów.
 */
.wdtr-registration,
.wdtr-summary,
.wdtr-notice {
    --wdtr-color-ink: var(--wdt-text, #242424);
    --wdtr-color-muted: var(--wdt-muted, #667085);
    --wdtr-color-line: rgba(36, 52, 73, .14);
    --wdtr-color-surface: #fff;
    --wdtr-color-surface-soft: #f8fafc;
    --wdtr-color-surface-warm: #fbfaf8;
    --wdtr-color-primary: #26384f;
    --wdtr-color-primary-soft: #eef3f8;
    --wdtr-color-primary-border: #cbd7e2;
    --wdtr-color-accent: #bf2028;
    --wdtr-color-accent-light: #d62d2d;
    --wdtr-color-accent-focus: rgba(191, 32, 40, .18);
    --wdtr-color-button-text: #fff;
    --wdtr-color-success: #4c9468;
    --wdtr-color-success-text: #14532A;
    --wdtr-color-success-bg: #f0fdf4;
    --wdtr-color-success-surface: #f3fbf6;
    --wdtr-color-success-border: #86efac;
    --wdtr-color-success-meta-border: rgba(76, 148, 104, .18);
    --wdtr-color-error: #e11d48;
    --wdtr-color-error-text: #881337;
    --wdtr-color-error-bg: #fff1f2;
    --wdtr-color-error-surface: #fff1f2;
    --wdtr-color-error-border: #fecdd3;
    --wdtr-color-error-meta-border: rgba(225, 29, 72, .20);
    --wdtr-color-warning-text: #755620;
    --wdtr-color-warning-bg: #fff8e8;
    --wdtr-color-warning-surface: #fffdf8;
    --wdtr-color-warning-border: #ead7a8;
    --wdtr-color-warning-meta-border: rgba(182, 139, 53, .20);
}

/* Formularz rejestracyjny */
.wdtr-registration {
    max-width: 980px;
    margin: 0 auto;
    color: var(--wdtr-color-ink);
}

.wdtr-registration .wdtr-form {
    display: block;
    width: 100%;
}

.wdtr-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 20px;
    width: 100%;
}

.wdtr-field {
    display: block;
    min-width: 0;
}

.wdtr-field--100 { grid-column: span 6; }
.wdtr-field--50 { grid-column: span 3; }
.wdtr-field--33 { grid-column: span 2; }

.wdtr-field label,
.wdtr-field legend,
.wdtr-payment-methods legend {
    display: block;
    margin: 0 0 8px;
    color: var(--wdtr-color-ink);
    font-size: .97rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -.01em;
}

.wdtr-field input[type="text"],
.wdtr-field input[type="email"],
.wdtr-field input[type="tel"],
.wdtr-field input[type="number"],
.wdtr-field select,
.wdtr-field textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(36, 52, 73, .16);
    border-radius: 9px;
    background: var(--wdtr-color-surface);
    color: var(--wdtr-color-ink);
    font: inherit;
    box-shadow: 0 1px 2px rgba(36, 52, 73, .025);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.wdtr-field textarea {
    min-height: 132px;
    padding: 12px 14px;
    resize: vertical;
}

.wdtr-field input[type="text"]:hover,
.wdtr-field input[type="email"]:hover,
.wdtr-field input[type="tel"]:hover,
.wdtr-field input[type="number"]:hover,
.wdtr-field select:hover,
.wdtr-field textarea:hover {
    border-color: rgba(36, 52, 73, .28);
}

.wdtr-field input[type="text"]:focus,
.wdtr-field input[type="email"]:focus,
.wdtr-field input[type="tel"]:focus,
.wdtr-field input[type="number"]:focus,
.wdtr-field select:focus,
.wdtr-field textarea:focus {
    border-color: rgba(52, 75, 103, .7);
    box-shadow: 0 0 0 3px rgba(52, 75, 103, .12);
    outline: 0;
}

.wdtr-field fieldset,
.wdtr-surface-panel {
    box-sizing: border-box;
    margin: 0;
    border: 1px solid rgba(36, 52, 73, .16);
    border-radius: 12px;
}

.wdtr-field fieldset {
    padding: 17px 18px;
    background: var(--wdtr-color-surface-soft);
}

.wdtr-surface-panel {
    background: var(--wdtr-color-surface-warm);
}

.wdtr-field .wdtr-choice,
.wdtr-payment-methods .wdtr-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 0;
    font-weight: 400;
    line-height: 1.55;
}

.wdtr-choice:first-of-type {
    margin-top: 0;
}

.wdtr-choice input {
    flex: 0 0 auto;
    margin-top: 4px;
    accent-color: var(--wdtr-color-primary);
}

.wdtr-choice input:focus-visible {
    outline: 2px solid rgba(52, 75, 103, .7);
    outline-offset: 2px;
}

.wdtr-choice span {
    display: block;
}

.wdtr-field .wdtr-choice.is-disabled,
.wdtr-payment-methods .wdtr-choice.is-disabled {
    color: var(--wdtr-color-muted);
    cursor: not-allowed;
    opacity: .62;
}

.wdtr-payment-requirement {
    padding: 10px 12px;
    margin: 14px 0 0;
    border-left: 3px solid var(--wdtr-color-primary);
    background: var(--wdtr-color-primary-soft);
    color: var(--wdtr-color-ink);
    font-size: .9rem;
    line-height: 1.5;
}

.wdtr-help {
    margin: 7px 0 0;
    color: var(--wdtr-color-muted);
    font-size: .88rem;
    line-height: 1.55;
}

.wdtr-field-error {
    margin: 5px 0 0;
    color: var(--wdtr-color-error-text);
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.4;
}

.wdtr-field.is-error input[type="text"],
.wdtr-field.is-error input[type="email"],
.wdtr-field.is-error input[type="tel"],
.wdtr-field.is-error input[type="number"],
.wdtr-field.is-error select,
.wdtr-field.is-error textarea,
.wdtr-field.is-error fieldset {
    border-color: var(--wdtr-color-error);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, .09);
}

.wdtr-field.is-error input[type="text"]:focus,
.wdtr-field.is-error input[type="email"]:focus,
.wdtr-field.is-error input[type="tel"]:focus,
.wdtr-field.is-error input[type="number"]:focus,
.wdtr-field.is-error select:focus,
.wdtr-field.is-error textarea:focus {
    border-color: var(--wdtr-color-error);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, .13);
}

.wdtr-field.is-error > .wdtr-choice input[type="checkbox"] {
    outline: 2px solid var(--wdtr-color-error);
    outline-offset: 2px;
}

.wdtr-field--heading h3 {
    margin: 8px 0 0;
    color: var(--wdtr-color-ink);
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.02em;
}

.wdtr-field--paragraph,
.wdtr-field--html {
    color: var(--wdtr-color-ink);
    line-height: 1.68;
}

.wdtr-field--html > :first-child,
.wdtr-field--paragraph > :first-child {
    margin-top: 0;
}

.wdtr-field--html > :last-child,
.wdtr-field--paragraph > :last-child {
    margin-bottom: 0;
}

.wdtr-price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin: 28px 0 32px;
    font-size: 1rem;
}

.wdtr-price-box strong {
    color: #2a384d;
    font-size: 1.4rem;
    line-height: 1.2;
}

.wdtr-payment-methods {
    padding: 17px 18px;
    margin: 0 0 22px;
}

.wdtr-payment-methods legend {
    padding: 0 4px;
}

/* Wspólny konstruktor przycisków frontendu */
.wdtr-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    appearance: none;
    box-sizing: border-box;
    min-height: 46px;
    padding: 0 24px;
    border: 1px solid rgba(166, 24, 39, .26);
    border-radius: 9px;
    background: linear-gradient(180deg, var(--wdtr-color-accent-light) 0%, var(--wdtr-color-accent) 100%);
    color: var(--wdtr-color-button-text);
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    transition: filter .15s ease, background .15s ease, border-color .15s ease;
}

.wdtr-button:visited {
    color: var(--wdtr-color-button-text);
}

.wdtr-button:hover {
    color: var(--wdtr-color-button-text);
    text-decoration: none;
    filter: brightness(1.04);
}

.wdtr-button:active {
    filter: brightness(.98);
}

.wdtr-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--wdtr-color-accent-focus);
}

.wdtr-button[disabled] {
    opacity: .62;
    cursor: wait;
    filter: none;
}

.wdtr-button--submit {
    min-width: 210px;
}

.wdtr-summary .wdtr-button {
    min-width: 230px;
}

/*
 * Ochrona linków-przycisków przed stylami aktywnego motywu.
 * Obejmuje wyłącznie przyciski frontendu w obrębie wtyczki.
 */
.wdtr-registration a.wdtr-button,
.wdtr-registration a.wdtr-button:link,
.wdtr-registration a.wdtr-button:visited,
.wdtr-registration a.wdtr-button:hover,
.wdtr-registration a.wdtr-button:focus,
.wdtr-registration a.wdtr-button:active,
.wdtr-summary a.wdtr-button,
.wdtr-summary a.wdtr-button:link,
.wdtr-summary a.wdtr-button:visited,
.wdtr-summary a.wdtr-button:hover,
.wdtr-summary a.wdtr-button:focus,
.wdtr-summary a.wdtr-button:active {
    color: var(--wdtr-color-button-text) !important;
    -webkit-text-fill-color: var(--wdtr-color-button-text) !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: 0 !important;
    box-shadow: none;
}

.wdtr-registration a.wdtr-button::before,
.wdtr-registration a.wdtr-button::after,
.wdtr-summary a.wdtr-button::before,
.wdtr-summary a.wdtr-button::after {
    display: none !important;
    content: none !important;
}

.wdtr-registration a.wdtr-button:focus-visible,
.wdtr-summary a.wdtr-button:focus-visible {
    box-shadow: 0 0 0 3px var(--wdtr-color-accent-focus) !important;
}

/* Komunikaty */
.wdtr-notice {
    box-sizing: border-box;
    padding: 15px;
    margin: 0 0 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: var(--wdtr-color-surface-soft);
    color: var(--wdt-text, #0f172a);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.45;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.wdtr-notice strong {
    font-weight: 700;
}

.wdtr-notice ul {
    padding: 0;
    margin: .65em 0 0 20px;
}

.wdtr-notice--error {
    border-color: #e2e8f0;
    border-left: 5px solid var(--wdtr-color-error);
    background: var(--wdtr-color-surface-soft);
}

/* Element antyspamowy musi pozostać ukryty niezależnie od stylów motywu. */
.wdtr-hp,
.wdtr-hp label,
.wdtr-hp input {
    position: absolute !important;
    top: auto !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.wdtr-turnstile {
    margin: 18px 0;
}

/* Podsumowanie rejestracji */
.wdtr-summary {
    max-width: 780px;
    margin: 0 auto;
    color: var(--wdtr-color-ink);
}

.wdtr-summary-card {
    box-sizing: border-box;
    width: 100%;
    padding: clamp(26px, 4vw, 38px);
    border: 1px solid var(--wdtr-color-line);
    border-radius: 18px;
    background: var(--wdtr-color-surface);
    box-shadow: 0 14px 34px rgba(36, 52, 73, .07);
}

.wdtr-summary-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0 0 20px;
    text-align: center;
}

.wdtr-summary-hero__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 14px;
    margin: 0;
    border: 1px solid var(--wdtr-color-primary-border);
    border-radius: 999px;
    background: var(--wdtr-color-primary-soft);
    color: #40566d;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .015em;
}

.wdtr-summary-hero--is-success .wdtr-summary-hero__badge {
    border-color: var(--wdtr-color-success-border);
    background: var(--wdtr-color-success-bg);
    color: var(--wdtr-color-success-text);
}

.wdtr-summary-hero--is-error .wdtr-summary-hero__badge {
    border-color: var(--wdtr-color-error-border);
    background: var(--wdtr-color-error-bg);
    color: var(--wdtr-color-error-text);
}

.wdtr-summary-hero--is-warning .wdtr-summary-hero__badge {
    border-color: var(--wdtr-color-warning-border);
    background: var(--wdtr-color-warning-bg);
    color: var(--wdtr-color-warning-text);
}

.wdtr-summary .wdtr-summary-card__title {
    margin: 0;
    color: var(--wdtr-color-ink);
    font-size: clamp(1.92rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.03em;
}

.wdtr-summary .wdtr-summary-hero__lead {
    max-width: 560px;
    margin: 0;
    color: var(--wdtr-color-muted);
    font-size: 1rem;
    line-height: 1.68;
}

.wdtr-summary-spotlight {
    padding: 20px 22px 0;
    margin: 0 0 30px;
    border: 1px solid var(--wdtr-color-line);
    border-radius: 15px;
    background: var(--wdtr-color-surface-warm);
}

.wdtr-summary-field__label {
    display: block;
    margin: 0 0 6px;
    color: var(--wdtr-color-muted);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .01em;
}

.wdtr-summary .wdtr-summary-spotlight__name {
    margin: 0;
    color: var(--wdtr-color-ink);
    font-size: clamp(1.54rem, 3vw, 1.92rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.wdtr-summary-spotlight__amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0 16px;
    margin-top: 16px;
    border-top: 1px solid var(--wdtr-color-line);
}

.wdtr-summary-spotlight__amount span {
    color: var(--wdtr-color-muted);
    font-size: .92rem;
    font-weight: 600;
}

.wdtr-summary-amount {
    display: block;
    color: var(--wdtr-color-primary);
    font-size: clamp(1.25rem, 2.4vw, 1.55rem);
    font-weight: 800;
    line-height: 1.2;
}

.wdtr-summary-section {
    margin-top: 30px;
}

.wdtr-summary .wdtr-summary-section__title {
    margin: 0 0 12px;
    color: var(--wdtr-color-ink);
    font-size: 1.26rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.02em;
}

.wdtr-summary-details-list {
    margin: 0;
    border-top: 1px solid var(--wdtr-color-line);
}

.wdtr-summary-details-list .wdtr-summary-field {
    display: grid;
    grid-template-columns: minmax(170px, .42fr) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--wdtr-color-line);
}

.wdtr-summary-details-list .wdtr-summary-field__label {
    margin: 0;
}

.wdtr-summary-details-list .wdtr-summary-field__value {
    margin: 0;
    color: var(--wdtr-color-ink);
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.wdtr-summary-note {
    padding: 16px 18px;
    margin-top: 24px;
    border: 1px solid var(--wdtr-color-line);
    border-radius: 12px;
    background: var(--wdtr-color-surface-soft);
    color: var(--wdtr-color-muted);
    line-height: 1.66;
}

.wdtr-summary-note p {
    margin: .35em 0;
}

/* Stan płatności — kolory są sterowane wyłącznie tokenami powyżej. */
.wdtr-summary-payment {
    position: relative;
    padding: 22px;
    margin-top: 30px;
    overflow: hidden;
    border: 1px solid var(--wdtr-color-primary-border);
    border-radius: 15px;
    background: var(--wdtr-color-surface-warm);
}

.wdtr-summary-payment::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--wdtr-color-primary);
}

.wdtr-summary-payment.is-success {
    border-color: var(--wdtr-color-success-border);
    background: var(--wdtr-color-success-surface);
}

.wdtr-summary-payment.is-success::before {
    background: var(--wdtr-color-success);
}

.wdtr-summary-payment.is-error {
    border-color: var(--wdtr-color-error-border);
    background: var(--wdtr-color-error-surface);
}

.wdtr-summary-payment.is-error::before {
    background: var(--wdtr-color-error);
}

.wdtr-summary-payment.is-warning {
    border-color: var(--wdtr-color-warning-border);
    background: var(--wdtr-color-warning-surface);
}

.wdtr-summary-payment__header {
    display: block;
    margin: 0;
}

.wdtr-summary-payment .wdtr-summary-section__title {
    margin: 0;
}

.wdtr-summary-payment__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wdtr-summary-payment__method {
    margin: 0;
    color: var(--wdtr-color-muted);
    font-size: .96rem;
    line-height: 1.6;
}

.wdtr-summary-payment__meta {
    display: block;
    margin: 0 0 16px;
}

.wdtr-summary-payment__meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(36, 52, 73, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
}

.wdtr-summary-payment__meta-label {
    display: block;
    margin: 0;
    color: var(--wdtr-color-muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.wdtr-summary-payment__meta-value {
    display: block;
    margin: 0;
    color: var(--wdtr-color-ink);
    font-size: 1rem;
    line-height: 1.35;
    text-align: right;
}

.wdtr-summary-payment.is-success .wdtr-summary-payment__meta-item {
    border-color: var(--wdtr-color-success-meta-border);
    background: rgba(255, 255, 255, .86);
}

.wdtr-summary-payment.is-error .wdtr-summary-payment__meta-item {
    border-color: var(--wdtr-color-error-meta-border);
    background: rgba(255, 255, 255, .86);
}

.wdtr-summary-payment.is-warning .wdtr-summary-payment__meta-item {
    border-color: var(--wdtr-color-warning-meta-border);
    background: rgba(255, 255, 255, .82);
}

.wdtr-summary-payment.is-onsite .wdtr-summary-payment__meta-item {
    border-color: rgba(167, 134, 78, .18);
    background: rgba(255, 255, 255, .78);
}

.wdtr-summary-payment-copy {
    color: var(--wdtr-color-ink);
    font-size: .99rem;
    line-height: 1.7;
}

.wdtr-summary-payment-copy > :first-child {
    margin-top: 0;
}

.wdtr-summary-payment-copy > :last-child {
    margin-bottom: 0;
}

.wdtr-summary-payment-copy p {
    margin: .35em 0 .85em;
}

.wdtr-payment-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 18px;
    margin-top: 20px;
    border-top: 1px solid var(--wdtr-color-line);
}

.wdtr-retry-form {
    margin: 0;
}

.wdtr-payment-wait {
    margin: 0;
    color: var(--wdtr-color-muted);
    font-size: .94rem;
    line-height: 1.6;
}

.wdtr-summary-home-action {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

@media (max-width: 700px) {
    .wdtr-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wdtr-field--100,
    .wdtr-field--50,
    .wdtr-field--33 {
        grid-column: auto;
    }

    .wdtr-price-box {
        padding: 15px 16px;
        margin: 24px 0 28px;
    }

    .wdtr-price-box strong {
        font-size: 1.28rem;
    }

    .wdtr-registration .wdtr-button,
    .wdtr-summary .wdtr-button {
        width: 100%;
        min-width: 0;
    }

    .wdtr-summary-card {
        padding: 22px 18px;
        border-radius: 15px;
    }

    .wdtr-summary-spotlight {
        padding: 18px 16px 0;
        margin-bottom: 24px;
    }

    .wdtr-summary-details-list .wdtr-summary-field {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 13px 0;
    }

    .wdtr-summary-payment {
        padding: 18px 16px;
    }

    .wdtr-summary-payment__meta {
        margin: 12px 0 14px;
    }

    .wdtr-summary-payment__meta-item {
        padding: 12px;
    }

    .wdtr-summary-payment__meta-value {
        text-align: left;
    }

    .wdtr-payment-actions {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .wdtr-summary-card {
        padding: 18px 15px;
    }

    .wdtr-summary-spotlight__amount,
    .wdtr-price-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .wdtr-summary-spotlight__amount {
        gap: 5px;
    }

    .wdtr-price-box {
        gap: 6px;
    }
}
