/* ============================================================
   Event Registration Manager — Public Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --er-primary:     #1a1a2e;
    --er-accent:      #e94560;
    --er-accent-2:    #0f3460;
    --er-gold:        #f5a623;
    --er-bg:          #ffffff;
    --er-surface:     #f8f9fb;
    --er-border:      #e2e6ea;
    --er-text:        #1a1a2e;
    --er-muted:       #6c7a8a;
    --er-radius:      12px;
    --er-shadow:      0 4px 24px rgba(26,26,46,.10);
    --er-shadow-lg:   0 12px 48px rgba(26,26,46,.18);
}

/* ── Wrap ── */
.er-wrap {
    font-family: 'DM Sans', sans-serif;
    color: var(--er-text);
    max-width: 760px;
    margin: 0 auto 60px;
}

/* ── Banner ── */
.er-banner {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: var(--er-radius) var(--er-radius) 0 0;
    position: relative;
}
.er-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(26,26,46,.7));
    border-radius: inherit;
}

/* ── Header ── */
.er-header {
    background: linear-gradient(135deg, var(--er-primary) 0%, var(--er-accent-2) 100%);
    padding: 36px 40px 32px;
    border-radius: 0;
}
.er-wrap .er-banner + .er-header { border-radius: 0; }
.er-wrap:not(:has(.er-banner)) .er-header { border-radius: var(--er-radius) var(--er-radius) 0 0; }
.er-event-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.2;
}
.er-event-date,
.er-event-location {
    color: rgba(255,255,255,.8);
    margin: 4px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.er-icon { font-size: 16px; }

/* ── Description ── */
.er-description {
    background: var(--er-surface);
    border-left: 4px solid var(--er-accent);
    padding: 24px 32px;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

/* ── Code of Conduct ── */
.er-conduct {
    border: 1px solid var(--er-border);
    border-radius: var(--er-radius);
    padding: 24px 28px;
    margin: 24px 0;
    background: #fffef7;
}
.er-section-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--er-primary);
    margin: 0 0 12px;
}
.er-conduct-body {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    padding-right: 8px;
    margin-bottom: 16px;
}
.er-conduct-agree {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Form Container ── */
.er-form-container {
    background: var(--er-bg);
    border: 1px solid var(--er-border);
    border-radius: 0 0 var(--er-radius) var(--er-radius);
    box-shadow: var(--er-shadow);
    padding: 36px 40px;
}

/* ── Fieldset ── */
.er-fieldset {
    border: 1px solid var(--er-border);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 24px;
}
.er-legend {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--er-primary);
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.er-price-badge {
    background: var(--er-accent);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ── Rows / Fields ── */
.er-row { display: grid; gap: 16px; }
.er-row-2 { grid-template-columns: 1fr 1fr; }
.er-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.er-field { margin-bottom: 16px; }
.er-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--er-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.er-req { color: var(--er-accent); }
.er-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--er-border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--er-text);
    background: var(--er-bg);
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.er-input:focus {
    outline: none;
    border-color: var(--er-accent);
    box-shadow: 0 0 0 3px rgba(233,69,96,.12);
}

/* ── Guests ── */
.er-guest-card {
    background: var(--er-surface);
    border: 1px solid var(--er-border);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
    position: relative;
}
.er-guest-card h4 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--er-accent-2);
}
.er-remove-guest {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--er-muted);
    line-height: 1;
}
.er-remove-guest:hover { color: var(--er-accent); }
.er-add-guest-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px dashed var(--er-border);
    color: var(--er-accent-2);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all .2s;
    margin-top: 4px;
}
.er-add-guest-btn:hover {
    border-color: var(--er-accent);
    color: var(--er-accent);
    background: rgba(233,69,96,.04);
}

/* ── Extras ── */
.er-extras-grid {
    display: grid;
    gap: 12px;
}
.er-extra-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 2px solid var(--er-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
}
.er-extra-item:hover {
    border-color: var(--er-accent);
    background: rgba(233,69,96,.03);
}
.er-extra-item input[type=checkbox] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--er-accent);
    flex-shrink: 0;
    cursor: pointer;
}
.er-extra-item:has(input:checked) {
    border-color: var(--er-accent);
    background: rgba(233,69,96,.05);
}
.er-extra-thumb {
    display: block;
    width: 100%;
    max-width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--er-border);
    margin-bottom: 10px;
}
.er-extra-content { flex: 1; min-width: 0; }
.er-extra-label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--er-text);
}
.er-extra-desc {
    display: block;
    font-size: 13px;
    color: var(--er-muted);
    margin-top: 2px;
}
.er-extra-price {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: var(--er-accent);
    margin-top: 6px;
}

/* ── Coupon ── */
.er-coupon-row {
    display: flex;
    gap: 12px;
}
.er-coupon-input { flex: 1; }
.er-coupon-btn {
    background: var(--er-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 22px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.er-coupon-btn:hover { background: var(--er-accent); }
.er-coupon-msg {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}
.er-coupon-success { color: #27ae60; }
.er-coupon-error   { color: var(--er-accent); }

/* ── Summary ── */
.er-summary {
    background: var(--er-primary);
    border-radius: var(--er-radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    color: #fff;
}
.er-summary-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    margin: 0 0 16px;
    color: #fff;
}
.er-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255,255,255,.75);
    padding: 5px 0;
}
.er-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 22px;
    font-weight: 700;
    border-top: 1px solid rgba(255,255,255,.2);
    margin-top: 12px;
    padding-top: 14px;
    color: var(--er-gold);
    font-family: 'Playfair Display', serif;
}

/* ── Payment ── */
.er-payment-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.er-payment-opt {
    flex: 1;
    min-width: 140px;
}
.er-payment-opt input[type=radio] { display: none; }
.er-payment-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--er-border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all .2s;
    text-align: center;
}
.er-payment-label:hover { border-color: var(--er-accent); }
.er-payment-opt input:checked + .er-payment-label {
    border-color: var(--er-accent);
    background: rgba(233,69,96,.05);
    color: var(--er-accent);
}
.er-pay-logo {
    height: 32px;
    object-fit: contain;
}

/* ── Errors ── */
.er-form-errors {
    background: #fff0f2;
    border: 1px solid #fbb;
    border-radius: 8px;
    padding: 14px 18px;
    color: #c0392b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    display: none;
}

/* ── Submit ── */
.er-submit-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--er-accent) 0%, #c0392b 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(233,69,96,.35);
}
.er-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(233,69,96,.45);
}
.er-submit-btn:active { transform: translateY(0); }
.er-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Success ── */
.er-success {
    text-align: center;
    padding: 48px 24px;
}
.er-success-icon { font-size: 64px; margin-bottom: 16px; }
.er-success-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: var(--er-primary);
    margin-bottom: 16px;
}
.er-success-message {
    font-size: 16px;
    color: var(--er-muted);
    max-width: 440px;
    margin: 0 auto 28px;
    line-height: 1.6;
}
.er-payment-redirect .er-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    margin: 8px;
    transition: transform .15s;
}
.er-pay-btn:hover { transform: translateY(-2px); }
.er-pay-btn-paypal { background: #003087; }
.er-pay-btn-venmo  { background: #008cff; }
.er-pay-total {
    font-size: 28px;
    font-weight: 800;
    color: var(--er-accent);
    font-family: 'Playfair Display', serif;
    margin-bottom: 16px;
}
.er-pay-instructions {
    font-size: 13px;
    color: var(--er-muted);
    max-width: 440px;
    margin: 16px auto 0;
}

/* ── Notices ── */
.er-notice {
    padding: 20px 24px;
    background: #eaf4ff;
    border: 1px solid #bee3f8;
    border-radius: 10px;
    font-size: 16px;
    color: #2b6cb0;
    font-weight: 600;
    text-align: center;
}
.er-error { color: var(--er-accent); font-weight: 600; }

/* ── Admin status badges ── */
.er-status { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.er-status-pending  { background: #fff3cd; color: #856404; }
.er-status-paid     { background: #d1e7dd; color: #0a3622; }
.er-status-failed   { background: #f8d7da; color: #842029; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .er-wrap {
        margin: 0 0 40px;
        max-width: 100%;
        border-radius: 0;
    }
    .er-header {
        padding: 24px 16px;
        border-radius: 0;
    }
    .er-form-container { padding: 20px 16px; }
    .er-fieldset { padding: 16px 14px; }
    .er-description, .er-conduct { padding: 16px 14px; }
    .er-summary { padding: 16px 14px; }
    .er-row-2, .er-row-3 { grid-template-columns: 1fr; }
    .er-payment-options { flex-direction: column; }
    .er-coupon-row { flex-direction: column; }
    .er-coupon-btn { padding: 12px; }
    .er-banner { height: 200px; border-radius: 0; }
}

/* ============================================================
   Terms & Conditions
   ============================================================ */

.er-terms-wrap { border-color: #0f3460; }
.er-terms-preview { font-size: 14px; color: var(--er-muted); margin: 0 0 12px; }

.er-terms-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--er-accent-2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.er-terms-open-btn:hover { background: #0a2744; transform: translateY(-1px); }
.er-terms-open-btn.er-terms-agreed {
    background: #27ae60;
    cursor: default;
    transform: none;
}

/* ── Modal Overlay ── */
.er-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, .65);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.er-modal-overlay.active {
    display: flex;
    animation: er-fade-in .2s ease;
}
@keyframes er-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Box ── */
.er-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    animation: er-slide-up .25s ease;
}
@keyframes er-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Modal Header ── */
.er-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--er-border);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--er-primary), var(--er-accent-2));
    border-radius: 14px 14px 0 0;
}
.er-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #fff;
    margin: 0;
}
.er-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .2s;
    flex-shrink: 0;
}
.er-modal-close:hover { background: rgba(255,255,255,.3); }

/* ── Modal Body ── */
.er-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    font-size: 14px;
    line-height: 1.75;
    color: #3a3a4a;
}
.er-modal-body h1,
.er-modal-body h2,
.er-modal-body h3 {
    font-family: 'Playfair Display', serif;
    color: var(--er-primary);
    margin-top: 20px;
}
.er-modal-body p { margin-bottom: 12px; }
.er-modal-body ul,
.er-modal-body ol { padding-left: 20px; margin-bottom: 12px; }
.er-modal-body li { margin-bottom: 6px; }

/* ── Modal Footer ── */
.er-modal-footer {
    padding: 18px 28px 22px;
    border-top: 1px solid var(--er-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
    background: var(--er-surface);
    border-radius: 0 0 14px 14px;
}
.er-modal-agree-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--er-text);
    cursor: pointer;
    flex: 1;
}
.er-modal-agree-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--er-accent);
    flex-shrink: 0;
}
.er-modal-accept-btn {
    background: var(--er-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}
.er-modal-accept-btn:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-1px);
}
.er-modal-accept-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 600px) {
    .er-modal { max-height: 92vh; }
    .er-modal-header { padding: 16px 18px 14px; }
    .er-modal-body { padding: 18px; }
    .er-modal-footer { padding: 14px 18px 18px; flex-direction: column; align-items: stretch; }
    .er-modal-accept-btn { width: 100%; text-align: center; }
}

/* ============================================================
   Fix paragraph / line break spacing in text sections
   ============================================================ */

.er-description p,
.er-conduct-body p,
.er-modal-body p {
    margin-bottom: 1em !important;
    display: block !important;
}

.er-description br,
.er-conduct-body br,
.er-modal-body br {
    display: block !important;
    content: '' !important;
    margin-bottom: .6em !important;
}

.er-description p:last-child,
.er-conduct-body p:last-child,
.er-modal-body p:last-child {
    margin-bottom: 0 !important;
}

.er-description h1,.er-description h2,.er-description h3,
.er-description h4,.er-description h5,.er-description h6 {
    margin-top: 1.2em !important;
    margin-bottom: .5em !important;
}

.er-description ul,
.er-description ol,
.er-conduct-body ul,
.er-conduct-body ol,
.er-modal-body ul,
.er-modal-body ol {
    padding-left: 1.5em !important;
    margin-bottom: 1em !important;
}

.er-description li,
.er-conduct-body li,
.er-modal-body li {
    margin-bottom: .4em !important;
}

/* ── Payment badges (replaces SVG logos) ── */
.er-pay-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.er-pay-badge-paypal {
    background: #003087;
    color: #fff;
    font-family: Arial, sans-serif;
}
.er-pay-badge-paypal::first-letter {
    color: #009cde;
}
.er-pay-badge-venmo {
    background: #008cff;
    color: #fff;
    font-family: Arial, sans-serif;
}

/* ── Venmo logo sizing ── */
.er-pay-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* ── Custom Questions ── */
.er-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.er-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}
.er-radio-label input[type="radio"],
.er-radio-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ── Extras thumb: float left on desktop, stacks above text on mobile ── */
@media (min-width: 601px) {
    .er-extra-has-img .er-extra-content {
        display: flex;
        align-items: flex-start;
        gap: 14px;
    }
    .er-extra-has-img .er-extra-thumb {
        width: 64px;
        max-width: 64px;
        height: 64px;
        object-fit: cover;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .er-extra-has-img .er-extra-text {
        flex: 1;
        min-width: 0;
    }
}

/* ── Extra qty ── */
.er-extra-price-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.er-extra-qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.er-extra-item:has(input:checked) .er-extra-qty-wrap {
    opacity: 1;
    pointer-events: all;
}
.er-extra-qty-label {
    font-size: 13px;
    color: var(--er-muted);
    font-weight: 600;
    white-space: nowrap;
}
.er-extra-qty {
    width: 56px !important;
    padding: 4px 6px !important;
    font-size: 14px !important;
    text-align: center;
    border: 1px solid var(--er-border) !important;
    border-radius: 6px !important;
}
