/**
 * PTST Booking & Enquiry Modal v6 — design-system aligned.
 *
 * Companion file to /js/ptst-modal.js. All visual treatments use the
 * shared design tokens defined in css/colors_and_type.css so the modal
 * stays in lockstep with the rest of the site when tokens change.
 *
 * Defensive `!important` is kept ONLY on elements that Elementor's global
 * theme styles target aggressively (buttons, form inputs). Everything
 * else is plain selectors. Scope is `#ptst-modal-overlay …` for the same
 * reason — the overlay is appended to <body> and lives outside any
 * design-system wrapper, so we have no ancestor specificity to lean on.
 */

/* ============================================================
   1. OVERLAY + CONTAINER
   ============================================================ */

.ptst-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay, rgba(11, 27, 51, 0.55));
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.ptst-modal-overlay--open {
    display: flex;
    animation: ptst-modal-fade-in 0.18s ease-out both;
}
@keyframes ptst-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#ptst-modal-overlay .ptst-modal {
    background: var(--bg, #FFFFFF);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-lg, 0 18px 40px rgba(11, 27, 51, 0.16));
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;            /* anchor for the discard panel */
    font-family: var(--font-sans, inherit);
    font-size: 14px;
    color: var(--ink, #0B1B33);
    animation: ptst-modal-pop-in 0.22s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
@keyframes ptst-modal-pop-in {
    from { transform: translateY(8px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

/* ============================================================
   2. HEADER — deep blue with a hero-like gradient + scrim
   ============================================================ */

#ptst-modal-overlay .ptst-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 28px 20px;
    color: #FFFFFF;
    flex-shrink: 0;
    position: relative;
    /* Deep brand gradient with a subtle highlight at the top edge — same
       feel as the page heroes, scaled down for modal proportions. */
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(135deg, var(--brand-blue, #012F63) 0%, var(--brand-blue-deep, #08316B) 100%);
}

#ptst-modal-overlay .ptst-modal__header-text {
    min-width: 0;     /* lets the subtitle truncate cleanly */
    flex: 1;
}

#ptst-modal-overlay .ptst-modal__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin: 0 0 4px;
    color: #FFFFFF;
}

#ptst-modal-overlay .ptst-modal__subtitle {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78);
    word-break: break-word;
}

#ptst-modal-overlay .ptst-modal__close {
    appearance: none !important;
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #FFFFFF !important;
    font-size: 22px !important;
    line-height: 1 !important;
    width: 34px;
    height: 34px;
    border-radius: 999px !important;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    box-shadow: none !important;
    outline: none;
}
#ptst-modal-overlay .ptst-modal__close:hover,
#ptst-modal-overlay .ptst-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.20) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}
#ptst-modal-overlay .ptst-modal__close:focus-visible {
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}

/* ============================================================
   3. STEP INDICATOR — clickable on done steps
   ============================================================ */

#ptst-modal-overlay .ptst-modal__steps {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 28px;
    background: var(--bg-soft, #F4F7FB);
    border-bottom: 1px solid var(--line, #E2E8F2);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* When wrapped in a <button> (done steps), reset native button styling. */
#ptst-modal-overlay .ptst-step-item {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 2px 6px;
    cursor: default;
    font: inherit;
    color: inherit;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.12s;
}
#ptst-modal-overlay .ptst-step-item--clickable {
    cursor: pointer;
}
#ptst-modal-overlay .ptst-step-item--clickable:hover,
#ptst-modal-overlay .ptst-step-item--clickable:focus-visible {
    background: rgba(1, 47, 99, 0.06);
    outline: none;
}

#ptst-modal-overlay .ptst-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--line, #E2E8F2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-3, #4A5C7A);
    background: #FFFFFF;
    transition: all 0.18s;
}
#ptst-modal-overlay .ptst-step-dot--active {
    border-color: var(--brand-blue, #012F63);
    background: var(--brand-blue, #012F63);
    color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(1, 47, 99, 0.12);
}
#ptst-modal-overlay .ptst-step-dot--done {
    border-color: var(--success, #1F8A5B);
    background: var(--success, #1F8A5B);
    color: #FFFFFF;
}

#ptst-modal-overlay .ptst-step-label {
    font-size: 11px;
    color: var(--ink-3, #4A5C7A);
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.01em;
}
#ptst-modal-overlay .ptst-step-item--active .ptst-step-label {
    color: var(--brand-blue, #012F63);
}

#ptst-modal-overlay .ptst-step-line {
    flex: 1;
    height: 2px;
    background: var(--line, #E2E8F2);
    margin: 0 2px 16px;
    min-width: 16px;
    border-radius: 999px;
}
#ptst-modal-overlay .ptst-step-line--done {
    background: var(--success, #1F8A5B);
}

/* ============================================================
   4. BODY
   ============================================================ */

#ptst-modal-overlay .ptst-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 28px;
    position: relative;
}

/* ============================================================
   5. COURSE SUMMARY PILL
   ============================================================ */

#ptst-modal-overlay .ptst-course-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-soft, #F4F7FB);
    border: 1px solid var(--line, #E2E8F2);
    border-radius: var(--radius-md, 10px);
    padding: 12px 16px;
    margin-bottom: 22px;
    gap: 12px;
}
#ptst-modal-overlay .ptst-course-pill__name {
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-blue, #012F63);
    letter-spacing: -0.005em;
}
#ptst-modal-overlay .ptst-course-pill__meta {
    font-size: 12px;
    color: var(--ink-3, #4A5C7A);
    margin-top: 2px;
    line-height: 1.4;
}
#ptst-modal-overlay .ptst-course-pill__meta strong {
    color: var(--ink, #0B1B33);
}

/* ============================================================
   6. FORM ELEMENTS
   ============================================================ */

#ptst-modal-overlay .ptst-form-section {
    margin-bottom: 22px;
}
#ptst-modal-overlay .ptst-form-section__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line, #E2E8F2);
}
#ptst-modal-overlay .ptst-form-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line, #E2E8F2);
}
#ptst-modal-overlay .ptst-form-section__header .ptst-form-section__title {
    margin: 0;
    padding: 0;
    border-bottom: 0;
}

#ptst-modal-overlay .ptst-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
#ptst-modal-overlay .ptst-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}
#ptst-modal-overlay .ptst-form-row .ptst-form-group {
    margin-bottom: 0;
}

#ptst-modal-overlay .ptst-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2, #1F2D44);
    letter-spacing: 0.005em;
}
#ptst-modal-overlay .ptst-label--sm {
    font-size: 11px;
    color: var(--ink-3, #4A5C7A);
    margin-bottom: 2px;
}
#ptst-modal-overlay .ptst-required {
    color: var(--danger, #C0392B);
    margin-left: 2px;
}

/* Inputs / selects / textareas — single consistent treatment. */
#ptst-modal-overlay .ptst-input {
    appearance: none !important;
    width: 100%;
    box-sizing: border-box;
    background: #FFFFFF !important;
    border: 1px solid var(--line, #E2E8F2) !important;
    border-radius: var(--radius-md, 10px) !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: var(--ink, #0B1B33) !important;
    font-family: var(--font-sans, inherit) !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#ptst-modal-overlay .ptst-input:hover {
    border-color: var(--ink-4, #889AB7) !important;
}
#ptst-modal-overlay .ptst-input:focus {
    outline: none !important;
    border-color: var(--brand-blue, #012F63) !important;
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}
#ptst-modal-overlay .ptst-input::placeholder {
    color: var(--ink-4, #889AB7);
    opacity: 1;
}

/* Per-field error state — set by JS adding .ptst-input--error. */
#ptst-modal-overlay .ptst-input--error,
#ptst-modal-overlay .ptst-input--error:focus {
    border-color: var(--danger, #C0392B) !important;
    box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.15) !important;
}

/* Inline per-field error message that sits below the input. */
#ptst-modal-overlay .ptst-field-error {
    font-size: 12px;
    color: var(--danger, #C0392B);
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}
#ptst-modal-overlay .ptst-field-error::before {
    content: "⚠";
    font-size: 11px;
    line-height: 1;
    margin-top: 2px;
}

#ptst-modal-overlay .ptst-textarea {
    resize: vertical;
    min-height: 84px;
}

#ptst-modal-overlay .ptst-help-text {
    font-size: 13px;
    color: var(--ink-3, #4A5C7A);
    margin: 0 0 14px;
    line-height: 1.55;
}
#ptst-modal-overlay .ptst-help-text--muted {
    color: var(--ink-4, #889AB7);
    font-style: italic;
    margin-top: 18px;
}

/* Checkbox label — rebuild from primitives so it lines up nicely. */
#ptst-modal-overlay .ptst-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink, #0B1B33);
    user-select: none;
}
#ptst-modal-overlay .ptst-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-blue, #012F63);
    margin: 0;
}

/* ============================================================
   7. TYPE CARDS — booking type selection
   ============================================================ */

#ptst-modal-overlay .ptst-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
#ptst-modal-overlay .ptst-type-card {
    appearance: none !important;
    background: #FFFFFF !important;
    border: 2px solid var(--line, #E2E8F2) !important;
    border-radius: var(--radius-md, 10px) !important;
    padding: 18px 14px !important;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
    font-family: var(--font-sans, inherit) !important;
    font-size: inherit !important;
    color: var(--ink, #0B1B33) !important;
    box-shadow: none !important;
    width: 100%;
    line-height: 1.4 !important;
    white-space: normal;       /* override native <button> nowrap default */
}
#ptst-modal-overlay .ptst-type-card:hover {
    border-color: var(--brand-blue-100, #D6E7F4) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
    transform: translateY(-1px);
}
#ptst-modal-overlay .ptst-type-card--active,
#ptst-modal-overlay .ptst-type-card--active:hover {
    border-color: var(--brand-blue, #012F63) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
}
#ptst-modal-overlay .ptst-type-card:focus-visible {
    outline: none !important;
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}
/* The button is a column so icon → label → desc stack vertically.
   Native <button> + <span> children default to inline; this resets that. */
#ptst-modal-overlay .ptst-type-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#ptst-modal-overlay .ptst-type-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 10px);
    background: var(--brand-blue-50, #EEF4FB);
    color: var(--brand-blue, #012F63);
    margin: 0 0 10px;
    flex-shrink: 0;
}
#ptst-modal-overlay .ptst-type-card--active .ptst-type-card__icon {
    background: var(--brand-blue, #012F63);
    color: #FFFFFF;
}
#ptst-modal-overlay .ptst-type-card__icon svg {
    stroke: currentColor;
    fill: none;
    display: block;
}
#ptst-modal-overlay .ptst-type-card__label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink, #0B1B33);
    margin-bottom: 4px;
    letter-spacing: -0.005em;
}
#ptst-modal-overlay .ptst-type-card__desc {
    display: block;
    font-size: 12px;
    color: var(--ink-3, #4A5C7A);
    line-height: 1.45;
}

/* ============================================================
   8. DATE CARDS — class date selection
   ============================================================ */

#ptst-modal-overlay .ptst-date-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
#ptst-modal-overlay .ptst-date-card {
    appearance: none !important;
    background: #FFFFFF !important;
    border: 2px solid var(--line, #E2E8F2) !important;
    border-radius: var(--radius-md, 10px) !important;
    padding: 14px 16px !important;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
    text-align: left;
    width: 100%;
    font-family: var(--font-sans, inherit) !important;
    color: var(--ink, #0B1B33) !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    font-size: inherit !important;
    white-space: normal;
}
#ptst-modal-overlay .ptst-date-card:hover {
    border-color: var(--brand-blue-100, #D6E7F4) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
}
#ptst-modal-overlay .ptst-date-card--selected,
#ptst-modal-overlay .ptst-date-card--selected:hover {
    border-color: var(--brand-blue, #012F63) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
}
#ptst-modal-overlay .ptst-date-card:focus-visible {
    outline: none !important;
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}
#ptst-modal-overlay .ptst-date-card {
    display: block;     /* button defaults inline-block; let spans stack */
}
#ptst-modal-overlay .ptst-date-card__date {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink, #0B1B33);
    letter-spacing: -0.005em;
}
#ptst-modal-overlay .ptst-date-card__venue {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-3, #4A5C7A);
    margin-top: 3px;
}
#ptst-modal-overlay .ptst-date-divider {
    text-align: center;
    color: var(--ink-4, #889AB7);
    margin: 16px 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* ============================================================
   9. ACCOMMODATION CARDS
   ============================================================ */

#ptst-modal-overlay .ptst-accom-card {
    appearance: none !important;
    background: #FFFFFF !important;
    border: 2px solid var(--line, #E2E8F2) !important;
    border-radius: var(--radius-md, 10px) !important;
    padding: 14px 16px !important;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans, inherit) !important;
    color: var(--ink, #0B1B33) !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    white-space: normal;       /* override native <button> nowrap default */
}
#ptst-modal-overlay .ptst-accom-card:hover {
    border-color: var(--brand-blue-100, #D6E7F4) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
}
#ptst-modal-overlay .ptst-accom-card--selected,
#ptst-modal-overlay .ptst-accom-card--selected:hover {
    border-color: var(--brand-blue, #012F63) !important;
    background: var(--brand-blue-50, #EEF4FB) !important;
}
#ptst-modal-overlay .ptst-accom-card:focus-visible {
    outline: none !important;
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}
#ptst-modal-overlay .ptst-accom-card {
    display: block;
}
#ptst-modal-overlay .ptst-accom-card__name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink, #0B1B33);
    letter-spacing: -0.005em;
}
#ptst-modal-overlay .ptst-accom-card__details {
    display: block;
    font-size: 13px;
    color: var(--ink-3, #4A5C7A);
    margin-top: 3px;
}
#ptst-modal-overlay .ptst-accom-card__notes {
    display: block;
    font-size: 12px;
    color: var(--ink-3, #4A5C7A);
    margin-top: 6px;
    font-style: italic;
}

/* ============================================================
   10. PARTICIPANT ROWS
   ============================================================ */

#ptst-modal-overlay .ptst-participant-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
    background: var(--bg-soft, #F4F7FB);
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--line, #E2E8F2);
}
#ptst-modal-overlay .ptst-participant-row__num {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    background: #FFFFFF;
    border: 1px solid var(--line, #E2E8F2);
    border-radius: 999px;
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
#ptst-modal-overlay .ptst-participant-row__fields {
    flex: 1;
    min-width: 0;
}
#ptst-modal-overlay .ptst-participant-row__fields .ptst-form-row {
    margin-bottom: 10px;
}
#ptst-modal-overlay .ptst-participant-row__fields .ptst-form-row:last-child {
    margin-bottom: 0;
}
#ptst-modal-overlay .ptst-participant-remove {
    appearance: none !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--ink-3, #4A5C7A) !important;
    font-size: 20px !important;
    cursor: pointer;
    padding: 0 !important;
    width: 30px;
    height: 30px;
    border-radius: 999px !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#ptst-modal-overlay .ptst-participant-remove:hover,
#ptst-modal-overlay .ptst-participant-remove:focus-visible {
    background: rgba(192, 57, 43, 0.08) !important;
    color: var(--danger, #C0392B) !important;
    border-color: rgba(192, 57, 43, 0.18) !important;
}
#ptst-modal-overlay .ptst-participant-remove-placeholder {
    width: 30px;
    flex-shrink: 0;
}

#ptst-modal-overlay .ptst-seats-badge {
    font-size: 12px;
    background: rgba(31, 138, 91, 0.10);
    color: var(--success, #1F8A5B);
    border: 1px solid rgba(31, 138, 91, 0.25);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ============================================================
   11. CONFIRM STEP
   ============================================================ */

#ptst-modal-overlay .ptst-confirm-section {
    font-size: 14px;
}
#ptst-modal-overlay .ptst-confirm-section__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    margin: 0 0 14px;
    letter-spacing: -0.005em;
}
#ptst-modal-overlay .ptst-confirm-block {
    background: var(--bg-soft, #F4F7FB);
    border: 1px solid var(--line, #E2E8F2);
    border-radius: var(--radius-md, 10px);
    padding: 14px 16px;
    margin-bottom: 12px;
}
#ptst-modal-overlay .ptst-confirm-block__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3, #4A5C7A);
    margin: 0 0 10px;
}
#ptst-modal-overlay .ptst-confirm-row {
    display: flex;
    gap: 14px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(226, 232, 242, 0.6);
    font-size: 13px;
}
#ptst-modal-overlay .ptst-confirm-row:last-child {
    border-bottom: none;
}
#ptst-modal-overlay .ptst-confirm-row__label {
    color: var(--ink-3, #4A5C7A);
    flex-shrink: 0;
    width: 120px;
    font-size: 12px;
    font-weight: 600;
}
#ptst-modal-overlay .ptst-confirm-row__value {
    color: var(--ink, #0B1B33);
    font-weight: 500;
    word-break: break-word;
}
#ptst-modal-overlay .ptst-confirm-participant {
    font-size: 13px;
    padding: 5px 0;
    color: var(--ink-2, #1F2D44);
    border-bottom: 1px solid rgba(226, 232, 242, 0.6);
}
#ptst-modal-overlay .ptst-confirm-participant:last-child {
    border-bottom: none;
}
#ptst-modal-overlay .ptst-confirm-note {
    font-size: 12px;
    color: var(--ink-3, #4A5C7A);
    font-style: italic;
    margin-top: 14px;
    line-height: 1.55;
}
#ptst-modal-overlay .ptst-turnstile-container {
    display: flex;
    justify-content: center;
}

/* ============================================================
   12. FOOTER + PRIMARY BUTTONS
   ============================================================ */

#ptst-modal-overlay .ptst-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid var(--line, #E2E8F2);
    background: var(--bg-soft, #F4F7FB);
    flex-shrink: 0;
    gap: 10px;
}
#ptst-modal-overlay .ptst-step-indicator {
    font-size: 12px;
    color: var(--ink-3, #4A5C7A);
    flex: 1;
    text-align: center;
    font-weight: 600;
}

#ptst-modal-overlay .ptst-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px !important;
    border-radius: var(--radius-md, 10px) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    border: 1px solid transparent !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.12s !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: none !important;
    font-family: var(--font-sans, inherit) !important;
    letter-spacing: 0.005em;
}

#ptst-modal-overlay .ptst-btn--primary {
    background: var(--brand-blue, #012F63) !important;
    color: #FFFFFF !important;
    border-color: var(--brand-blue, #012F63) !important;
}
#ptst-modal-overlay .ptst-btn--primary:hover,
#ptst-modal-overlay .ptst-btn--primary:focus-visible {
    background: var(--brand-blue-deep, #08316B) !important;
    border-color: var(--brand-blue-deep, #08316B) !important;
    color: #FFFFFF !important;
}
#ptst-modal-overlay .ptst-btn--primary:focus-visible {
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}
#ptst-modal-overlay .ptst-btn--primary:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* Submit on the final step — green (success), not alarming red. */
#ptst-modal-overlay .ptst-btn--submit {
    background: var(--success, #1F8A5B) !important;
    color: #FFFFFF !important;
    border-color: var(--success, #1F8A5B) !important;
}
#ptst-modal-overlay .ptst-btn--submit:hover,
#ptst-modal-overlay .ptst-btn--submit:focus-visible {
    background: #176D47 !important;
    border-color: #176D47 !important;
    color: #FFFFFF !important;
}
#ptst-modal-overlay .ptst-btn--submit:focus-visible {
    box-shadow: 0 0 0 4px rgba(31, 138, 91, 0.30) !important;
}
#ptst-modal-overlay .ptst-btn--submit:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

#ptst-modal-overlay .ptst-btn--ghost {
    background: transparent !important;
    color: var(--ink-2, #1F2D44) !important;
    border-color: var(--line, #E2E8F2) !important;
}
#ptst-modal-overlay .ptst-btn--ghost:hover,
#ptst-modal-overlay .ptst-btn--ghost:focus-visible {
    background: #FFFFFF !important;
    border-color: var(--ink-4, #889AB7) !important;
    color: var(--ink, #0B1B33) !important;
}
#ptst-modal-overlay .ptst-btn--ghost:focus-visible {
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(46, 143, 208, 0.30)) !important;
}

#ptst-modal-overlay .ptst-btn--danger {
    background: var(--danger, #C0392B) !important;
    color: #FFFFFF !important;
    border-color: var(--danger, #C0392B) !important;
}
#ptst-modal-overlay .ptst-btn--danger:hover,
#ptst-modal-overlay .ptst-btn--danger:focus-visible {
    background: #9F2E22 !important;
    border-color: #9F2E22 !important;
    color: #FFFFFF !important;
}

#ptst-modal-overlay .ptst-btn--sm {
    padding: 7px 14px !important;
    font-size: 13px !important;
}

/* ============================================================
   13. SUCCESS STATE
   ============================================================ */

#ptst-modal-overlay .ptst-success {
    text-align: center;
    padding: 40px 24px 32px;
}
#ptst-modal-overlay .ptst-success__icon {
    width: 64px;
    height: 64px;
    background: var(--success, #1F8A5B);
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 18px;
    box-shadow: 0 6px 18px rgba(31, 138, 91, 0.30);
}
#ptst-modal-overlay .ptst-success__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    margin: 0 0 10px;
    letter-spacing: -0.015em;
}
#ptst-modal-overlay .ptst-success__message {
    font-size: 14px;
    color: var(--ink-2, #1F2D44);
    line-height: 1.55;
    margin: 0 auto 14px;
    max-width: 400px;
}
#ptst-modal-overlay .ptst-success__ref {
    font-size: 14px;
    color: var(--ink, #0B1B33);
    margin: 0 0 6px;
}
#ptst-modal-overlay .ptst-success__email {
    font-size: 13px;
    color: var(--ink-3, #4A5C7A);
    margin: 0 0 26px;
}

/* ============================================================
   14. ERROR BANNER (aria-live="polite")
   ============================================================ */

#ptst-modal-overlay .ptst-error-banner {
    background: rgba(192, 57, 43, 0.06);
    border: 1px solid rgba(192, 57, 43, 0.30);
    border-left: 3px solid var(--danger, #C0392B);
    border-radius: var(--radius-sm, 6px);
    padding: 11px 14px;
    color: var(--danger, #C0392B);
    font-size: 13px;
    margin-top: 14px;
    line-height: 1.5;
    font-weight: 500;
}

/* ============================================================
   15. INFO + WAITLIST NOTICES
   ============================================================ */

#ptst-modal-overlay .ptst-info-block {
    background: var(--brand-blue-50, #EEF4FB);
    border-left: 3px solid var(--brand-blue, #012F63);
    border-radius: var(--radius-sm, 6px);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--ink-2, #1F2D44);
    line-height: 1.6;
    margin-bottom: 16px;
}

#ptst-modal-overlay .ptst-waitlist-notice {
    background: rgba(216, 142, 17, 0.08);
    border: 1px solid rgba(216, 142, 17, 0.30);
    border-left: 3px solid var(--warning, #D88E11);
    border-radius: var(--radius-sm, 6px);
    padding: 11px 14px;
    font-size: 13px;
    color: #6F4A0B;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ============================================================
   16. DISCARD-PROGRESS CONFIRMATION (NEW)
   --------------------------------------------------------------
   Slides up from inside the modal as an inset panel — covers
   the body while keeping the header visible, so the user can
   see what they're about to discard. Shown by toggling
   .ptst-modal__discard--open on the panel itself.
   ============================================================ */

#ptst-modal-overlay .ptst-modal__discard {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.18s;
}
#ptst-modal-overlay .ptst-modal__discard--open {
    display: flex;
    opacity: 1;
}
#ptst-modal-overlay .ptst-modal__discard-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(216, 142, 17, 0.12);
    color: var(--warning, #D88E11);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
#ptst-modal-overlay .ptst-modal__discard-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ink, #0B1B33);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
#ptst-modal-overlay .ptst-modal__discard-text {
    font-size: 14px;
    color: var(--ink-2, #1F2D44);
    margin: 0 0 22px;
    line-height: 1.55;
    max-width: 360px;
}
#ptst-modal-overlay .ptst-modal__discard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ============================================================
   17. LOADING SPINNER
   ============================================================ */

#ptst-modal-overlay .ptst-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    color: var(--ink-3, #4A5C7A);
    font-size: 14px;
    gap: 14px;
}
#ptst-modal-overlay .ptst-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--line, #E2E8F2);
    border-top-color: var(--brand-blue, #012F63);
    border-radius: 50%;
    animation: ptst-spin 0.7s linear infinite;
}
@keyframes ptst-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   18. MOBILE — slide-up sheet at ≤640px, single-column at all
   narrow widths.
   ============================================================ */

@media (max-width: 768px) {
    #ptst-modal-overlay .ptst-form-row {
        grid-template-columns: 1fr;
    }
    #ptst-modal-overlay .ptst-modal__header,
    #ptst-modal-overlay .ptst-modal__steps,
    #ptst-modal-overlay .ptst-modal__body,
    #ptst-modal-overlay .ptst-modal__footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 640px) {
    .ptst-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    #ptst-modal-overlay .ptst-modal {
        border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0;
        max-height: 95vh;
        max-width: 100%;
        animation: ptst-modal-slide-up 0.22s cubic-bezier(0.2, 0.8, 0.25, 1) both;
    }
    @keyframes ptst-modal-slide-up {
        from { transform: translateY(20px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
    #ptst-modal-overlay .ptst-type-grid {
        grid-template-columns: 1fr;
    }
    #ptst-modal-overlay .ptst-confirm-row__label {
        width: 100px;
    }
    #ptst-modal-overlay .ptst-step-label {
        display: none;     /* dots only on narrow screens */
    }
    #ptst-modal-overlay .ptst-step-line {
        margin-bottom: 0;
    }
    #ptst-modal-overlay .ptst-modal__footer {
        flex-direction: row;
    }
    #ptst-modal-overlay .ptst-modal__footer .ptst-step-indicator {
        display: none;     /* dots already convey this on mobile */
    }
}

@media (max-width: 480px) {
    #ptst-modal-overlay .ptst-modal__header,
    #ptst-modal-overlay .ptst-modal__steps,
    #ptst-modal-overlay .ptst-modal__body,
    #ptst-modal-overlay .ptst-modal__footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    #ptst-modal-overlay .ptst-modal__title {
        font-size: 16px;
    }
    #ptst-modal-overlay .ptst-modal__subtitle {
        font-size: 12px;
    }
}


/* ── Privacy-policy fine-print under the modal footer.
 *    Populated by ptst-modal.js when ptstConfig.privacyUrl is set. */
#ptst-modal-overlay .ptst-form-finetext {
    margin: 0;
    padding: 0 24px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-3, #5A6B86);
    text-align: center;
}
#ptst-modal-overlay .ptst-form-finetext a {
    color: var(--brand-blue, #0E4A9C);
    text-decoration: underline;
    text-underline-offset: 2px;
}
