/* ── IAB Event Checkout v2.0 — Styles (IAB Red Theme) ────────────────────── */
:root {
    --iec-red:        #E8001B;
    --iec-red-dark:   #b30014;
    --iec-red-light:  #fff0f1;
    --iec-red-mid:    #ffd6d9;
    --iec-green:      #22c55e;
    --iec-green-dark: #15803d;
    --iec-green-bg:   #f0fdf4;
    --iec-fail:       #ef4444;
    --iec-fail-bg:    #fef2f2;
    --iec-border:     #e5e7eb;
    --iec-bg:         #f9fafb;
    --iec-text:       #111827;
    --iec-muted:      #6b7280;
    --iec-radius:     12px;
    --iec-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --iec-shadow:     0 4px 24px rgba(0,0,0,.08);
    --iec-shadow-lg:  0 8px 40px rgba(0,0,0,.14);
}

/* ── Event list grid ─────────────────────────────────────────────────────── */
.iec-event-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
    font-family: var(--iec-font);
}

.iec-event-card {
    background: #fff;
    border: 1px solid var(--iec-border);
    border-radius: var(--iec-radius);
    overflow: hidden;
    box-shadow: var(--iec-shadow);
    transition: transform .25s, box-shadow .25s;
}
.iec-event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--iec-shadow-lg);
}

.iec-event-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.iec-no-thumb {
    background: linear-gradient(135deg, var(--iec-red-light) 0%, #ffe4e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
}

/* Red accent bar at top of card */
.iec-event-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
}
.iec-event-card:has(.iec-event-thumb)::before { display: none; }

.iec-event-body { padding: 20px; }

.iec-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.iec-event-date,
.iec-event-venue {
    font-size: 12px;
    color: var(--iec-muted);
    background: var(--iec-bg);
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--iec-border);
}

.iec-event-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.4;
    color: var(--iec-text);
}
.iec-event-title a { color: inherit; text-decoration: none; }
.iec-event-title a:hover { color: var(--iec-red); }

.iec-tier-prices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.iec-tier-badge {
    font-size: 12px;
    background: var(--iec-red-light);
    color: var(--iec-red-dark);
    border: 1px solid var(--iec-red-mid);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.iec-event-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.iec-btn-details {
    padding: 9px 18px;
    border: 1.5px solid var(--iec-border);
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s, color .2s;
}
.iec-btn-details:hover { border-color: var(--iec-red); color: var(--iec-red); }

.iec-btn-buy {
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    letter-spacing: .2px;
}
.iec-btn-buy:hover { opacity: .9; transform: translateY(-1px); }

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.iec-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    animation: iecFadeIn .2s ease;
}
@keyframes iecFadeIn { from{opacity:0} to{opacity:1} }

.iec-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    animation: iecSlideUp .25s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
@keyframes iecSlideUp { from{transform:translateY(40px);opacity:0} to{transform:translateY(0);opacity:1} }

.iec-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 15px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.iec-modal-close:hover { background: #ffe4e6; color: var(--iec-red); }

/* ── Stripe Popup Overlay (waiting dialog while Stripe window is open) ───── */
.iec-stripe-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(6px);
    animation: iecFadeIn .2s ease;
}

.iec-stripe-popup {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0,0,0,.28);
    overflow: hidden;
    animation: iecSlideUp .3s cubic-bezier(.16,1,.3,1);
}

.iec-stripe-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    font-family: var(--iec-font);
    flex-shrink: 0;
}

.iec-stripe-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.iec-stripe-close-btn:hover { background: rgba(255,255,255,.35); }

#iec-stripe-iframe {
    display: none; /* Not used — Stripe opens in popup window */
    flex: 1;
    width: 100%;
    border: none;
}

/* Waiting state shown while Stripe popup window is open */
.iec-stripe-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 44px 32px;
    min-height: 220px;
}
.iec-stripe-waiting p { margin: 0; }

.iec-stripe-footer {
    padding: 10px 20px;
    font-size: 12px;
    color: var(--iec-muted);
    text-align: center;
    background: var(--iec-bg);
    border-top: 1px solid var(--iec-border);
    font-family: var(--iec-font);
    flex-shrink: 0;
}

/* ── Checkout form ───────────────────────────────────────────────────────── */
.iec-checkout-form {
    font-family: var(--iec-font);
    overflow: hidden;
}

/* Banner */
.iec-form-banner {
    position: relative;
    min-height: 110px;
    background: linear-gradient(135deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
    overflow: hidden;
}
.iec-form-banner-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .25;
}
.iec-form-banner-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
}
.iec-iab-badge { flex-shrink: 0; }
.iec-form-banner-text { flex: 1; }
.iec-form-banner-text h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.iec-form-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.iec-form-banner-meta span {
    font-size: 13px;
    color: rgba(255,255,255,.88);
}

/* Form body padding */
.iec-form-body { padding: 24px; }

/* Section labels */
.iec-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--iec-red);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--iec-red-light);
}
.iec-form-body .iec-section-label:not(:first-child) { margin-top: 20px; }

/* Tier selector */
.iec-tier-selector { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.iec-tier-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--iec-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    position: relative;
}
.iec-tier-option input[type=radio] { accent-color: var(--iec-red); flex-shrink: 0; }
.iec-tier-option.selected,
.iec-tier-option:has(input:checked) {
    border-color: var(--iec-red);
    background: var(--iec-red-light);
    box-shadow: 0 0 0 3px rgba(232,0,27,.08);
}
.iec-tier-label { display: flex; justify-content: space-between; flex: 1; align-items: center; }
.iec-tier-label strong { font-size: 14px; color: var(--iec-text); }
.iec-tier-price { color: var(--iec-red); font-weight: 800; font-size: 15px; }
.iec-tier-popular-badge {
    position: absolute;
    top: -1px; right: 10px;
    background: var(--iec-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0 0 6px 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Quantity row */
.iec-qty-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.iec-qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--iec-border);
    border-radius: 10px;
    overflow: hidden;
    width: fit-content;
    transition: border-color .2s;
}
.iec-qty-selector:focus-within { border-color: var(--iec-red); }
.iec-qty-btn {
    width: 42px; height: 42px;
    border: none;
    background: var(--iec-bg);
    font-size: 22px;
    font-weight: 300;
    cursor: pointer;
    color: var(--iec-text);
    transition: background .15s, color .15s;
    display: flex; align-items: center; justify-content: center;
}
.iec-qty-btn:hover { background: var(--iec-red-light); color: var(--iec-red); }
.iec-qty-input {
    width: 54px;
    text-align: center;
    border: none;
    border-left: 1.5px solid var(--iec-border);
    border-right: 1.5px solid var(--iec-border);
    font-size: 17px;
    font-weight: 700;
    padding: 8px 0;
    outline: none;
    color: var(--iec-text);
    -moz-appearance: textfield;
}
.iec-qty-input::-webkit-outer-spin-button,
.iec-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Total pill */
.iec-total-pill {
    background: var(--iec-red-light);
    border: 1.5px solid var(--iec-red-mid);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    color: var(--iec-red-dark);
    font-weight: 600;
}
.iec-total-pill strong { font-size: 16px; color: var(--iec-red); }

/* Fields */
.iec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.iec-field { display: flex; flex-direction: column; margin-bottom: 14px; }
.iec-field label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.iec-req { color: var(--iec-red); }
.iec-input {
    padding: 11px 14px;
    border: 1.5px solid var(--iec-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--iec-text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--iec-font);
}
.iec-input:focus {
    border-color: var(--iec-red);
    box-shadow: 0 0 0 3px rgba(232,0,27,.1);
}

/* Order Summary box */
.iec-order-summary {
    background: var(--iec-bg);
    border: 1.5px solid var(--iec-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
}
.iec-order-summary-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--iec-muted);
    margin-bottom: 12px;
}
.iec-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}
.iec-order-label { color: var(--iec-muted); }
.iec-order-amount { color: var(--iec-text); font-weight: 600; }
.iec-order-divider { border: none; border-top: 1px dashed var(--iec-border); margin: 10px 0; }
.iec-order-total-row .iec-order-label strong { color: var(--iec-text); font-size: 15px; }
.iec-order-total-row .iec-order-total-amount strong { color: var(--iec-red); font-size: 17px; }

/* Submit button */
.iec-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    font-family: var(--iec-font);
    box-shadow: 0 4px 14px rgba(232,0,27,.35);
}
.iec-submit-btn:hover:not(:disabled) { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,0,27,.45); }
.iec-submit-btn:active { transform: translateY(0); }
.iec-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.iec-btn-icon { font-size: 15px; }

/* Spinner */
.iec-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: iecSpin .7s linear infinite;
    vertical-align: middle;
}
@keyframes iecSpin { to { transform: rotate(360deg); } }

.iec-secure-note {
    text-align: center;
    font-size: 12px;
    color: var(--iec-muted);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Error */
.iec-error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--iec-fail);
    font-size: 13px;
    margin: 0 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* ── Success animation ───────────────────────────────────────────────────── */
.iec-success {
    text-align: center;
    padding: 36px 28px;
}
.iec-success-animation { margin-bottom: 20px; }
.iec-success-circle {
    width: 80px; height: 80px;
    margin: 0 auto;
    background: var(--iec-green-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iecPopIn .4s cubic-bezier(.17,.67,.83,.97);
}
@keyframes iecPopIn { from{transform:scale(.5);opacity:0} to{transform:scale(1);opacity:1} }
.iec-checkmark {
    width: 52px; height: 52px;
}
.iec-checkmark-circle {
    stroke: var(--iec-green);
    stroke-width: 2;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: iecDashCircle .6s .3s ease forwards;
}
@keyframes iecDashCircle { to { stroke-dashoffset: 0; } }
.iec-checkmark-check {
    stroke: var(--iec-green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: iecDashCheck .4s .8s ease forwards;
}
@keyframes iecDashCheck { to { stroke-dashoffset: 0; } }
.iec-success h3 { color: var(--iec-green-dark); font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.iec-success p  { color: #166534; font-size: 14px; margin: 0; line-height: 1.6; }

/* ── Payment Failed ──────────────────────────────────────────────────────── */
.iec-failed {
    text-align: center;
    padding: 36px 28px;
    background: var(--iec-fail-bg);
    border-radius: 0 0 16px 16px;
}
.iec-failed-icon {
    width: 72px; height: 72px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 30px;
    color: var(--iec-fail);
    font-weight: 900;
    border: 3px solid #fca5a5;
    animation: iecPopIn .4s cubic-bezier(.17,.67,.83,.97);
}
.iec-failed h3 { color: #991b1b; font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.iec-failed p  { color: #7f1d1d; font-size: 14px; margin: 0 0 20px; }
.iec-retry-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--iec-red) 0%, var(--iec-red-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--iec-font);
    transition: opacity .2s;
}
.iec-retry-btn:hover { opacity: .88; }

/* ── Event page inline checkout ─────────────────────────────────────────── */
.iec-event-page-checkout {
    margin-top: 44px;
    border-top: 3px solid var(--iec-red-light);
    padding-top: 32px;
}
.iec-event-page-checkout-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 22px;
    color: var(--iec-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.iec-title-accent { color: var(--iec-red); }
.iec-event-page-checkout .iec-checkout-form {
    max-width: 540px;
    background: #fff;
    border: 1px solid var(--iec-border);
    border-radius: 16px;
    box-shadow: var(--iec-shadow);
    overflow: hidden;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .iec-event-list { grid-template-columns: 1fr; }
    .iec-row { grid-template-columns: 1fr; }
    .iec-form-body { padding: 18px; }
    .iec-modal { border-radius: 12px 12px 0 0; margin-top: auto; }
    .iec-stripe-popup { border-radius: 12px 12px 0 0; margin-top: auto; width: 100%; }
    .iec-qty-row { gap: 10px; }
    .iec-form-banner-text h3 { font-size: 15px; }
}
