/* =============================================
   Ticket Booking Form – frontend.css
   Primary brand: #1A7A7A
   Headings: Lora 700 22px
   Body: DM Sans 15px
   ============================================= */

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

/* ---------- Reset / wrapper ---------- */
.tbf-wrapper *,
.tbf-wrapper *::before,
.tbf-wrapper *::after { box-sizing: border-box; margin: 0; padding: 0; }

.tbf-wrapper {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 40px;
    position: relative;
}

/* ============================================================
   STEPS BAR
   ============================================================ */
.tbf-steps-bar {
    background: #EAF4F4;
    border: 1px solid #d0e8e8;
    border-radius: 14px;
    padding: 16px 30px 20px;
    margin-bottom: 32px;
}

.tbf-steps-title {
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.tbf-steps-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbf-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tbf-step-connector {
    flex: 1;
    height: 2px;
    background: #b5d5d5;
    transition: background 0.4s;
    min-width: 40px;
    max-width: 160px;
    margin-bottom: 24px;
}

.tbf-step-connector.active { background: #1A7A7A; }

.tbf-step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #b5d5d5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.tbf-step.active .tbf-step-circle { border-color: #1A7A7A; color: #1A7A7A; background: #fff; }
.tbf-step.completed .tbf-step-circle { border-color: #1A7A7A; background: #1A7A7A; color: #fff; }
.tbf-step.completed .tbf-step-circle span { display: none; }
.tbf-step.completed .tbf-step-circle::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) translateY(-2px);
}

.tbf-step-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #888;
    text-align: center;
    white-space: nowrap;
}

.tbf-step.active .tbf-step-label { color: #1A7A7A; font-weight: 600; }
.tbf-step.completed .tbf-step-label { color: #555; }

/* ============================================================
   PANELS
   ============================================================ */
.tbf-panel { display: none; animation: tbf-fade-in 0.3s ease; }
.tbf-panel.active { display: block; }

@keyframes tbf-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   REGISTER-FOR ROW
   ============================================================ */
.tbf-register-for {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-bottom: 18px;
    border-bottom: 1.5px solid #e0e0e0;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tbf-register-label {
    font-family: 'Lora', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.tbf-radio-group { display: flex; align-items: center; gap: 20px; margin-left: auto; }

.tbf-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    user-select: none;
}

.tbf-radio-label input[type="radio"] { display: none; }

.tbf-radio-custom {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid #b5d5d5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.tbf-radio-label input[type="radio"]:checked ~ .tbf-radio-custom { border-color: #1A7A7A; }
.tbf-radio-label input[type="radio"]:checked ~ .tbf-radio-custom::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #1A7A7A;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.tbf-section-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.2;
}

/* ============================================================
   ROWS / FIELDS
   ============================================================ */
.tbf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.tbf-row.single { grid-template-columns: 1fr; }
.tbf-field { display: flex; flex-direction: column; gap: 6px; }
.tbf-field label { font-size: 13px; font-weight: 600; color: #333; }
.tbf-field label .req { color: #e53e3e; margin-left: 2px; }
.tbf-field label .opt { font-weight: 400; color: #888; }

.tbf-field input[type="text"],
.tbf-field input[type="email"],
.tbf-field input[type="tel"],
.tbf-field input[type="number"],
.tbf-field input[type="date"] {
    height: 46px;
    border: 1.5px solid #d8e8e8;
    border-radius: 8px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.tbf-field textarea {
    border: 1.5px solid #d8e8e8;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
    min-height: 80px;
}

.tbf-field input::placeholder,
.tbf-field textarea::placeholder { color: #aaa; font-weight: 400; }
.tbf-field input:focus,
.tbf-field textarea:focus { border-color: #1A7A7A; box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }
.tbf-field input.tbf-invalid,
.tbf-field textarea.tbf-invalid,
.tbf-field select.tbf-invalid { border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229,62,62,0.08); }
.tbf-error { font-size: 11.5px; color: #e53e3e; min-height: 16px; display: block; }

/* Custom field radio/checkbox groups */
.tbf-custom-radio-group,
.tbf-custom-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* ============================================================
   SELECT
   ============================================================ */
.tbf-select-wrap { position: relative; }

.tbf-select-wrap select {
    width: 100%;
    height: 46px;
    border: 1.5px solid #d8e8e8;
    border-radius: 8px;
    padding: 0 42px 0 14px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.tbf-select-wrap select:focus { border-color: #1A7A7A; box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }

.tbf-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #666;
    pointer-events: none;
}

/* ============================================================
   CHECKBOX
   ============================================================ */
.tbf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: #444;
    margin-bottom: 24px;
    user-select: none;
    line-height: 1.4;
    text-align: left;
}

.tbf-checkbox-label .tbf-checkbox-custom {
    margin-top: 1px;
}

.tbf-checkbox-label input[type="checkbox"] { display: none; }

.tbf-checkbox-custom {
    width: 20px; height: 20px;
    border: 1.5px solid #b5d5d5;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: #fff;
}

.tbf-checkbox-label input[type="checkbox"]:checked ~ .tbf-checkbox-custom {
    background: #1A7A7A;
    border-color: #1A7A7A;
}

.tbf-checkbox-label input[type="checkbox"]:checked ~ .tbf-checkbox-custom::after {
    content: '';
    display: block;
    width: 10px; height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* ============================================================
   NEXT / ACTION BUTTON
   ============================================================ */
.tbf-btn-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    background: #1A7A7A;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.2px;
    padding: 0 24px;
}

.tbf-btn-next:hover { background: #155f5f; transform: translateY(-1px); }
.tbf-btn-next:active { transform: translateY(0); }
.tbf-btn-arrow { font-size: 18px; line-height: 1; }

/* ============================================================
   STEP 3 – SUMMARY
   ============================================================ */
.tbf-summary-table { margin-bottom: 8px; }

.tbf-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
}

.tbf-summary-row:last-child { border-bottom: none; }
.s-label { font-size: 14px; color: #555; min-width: 140px; text-align: left; }
.s-val { font-size: 14px; font-weight: 600; color: #1a1a1a; text-align: right; word-break: break-word; }
.tbf-divider { height: 1px; background: #e0e0e0; margin: 20px 0; }

.tbf-email-list-row {
    justify-content: flex-start !important;
}

.tbf-email-list-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    color: #333 !important;
    font-size: 13px !important;
    text-align: left !important;
}

.tbf-check-icon {
    width: 20px; height: 20px;
    border-radius: 4px;
    background: #1A7A7A;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

/* ============================================================
   STEP 3 – ACTION BUTTONS
   ============================================================ */
.tbf-confirm-actions { display: flex; gap: 14px; margin-top: 28px; }

.tbf-btn-edit {
    flex: 1;
    height: 52px;
    background: #fff;
    color: #1A7A7A;
    border: 1.5px solid #1A7A7A;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s, transform 0.15s;
}

.tbf-btn-edit:hover { background: #EAF4F4; transform: translateY(-1px); }

.tbf-edit-svg { width: 16px; height: 16px; flex-shrink: 0; color: #1A7A7A; }

.tbf-btn-confirm {
    flex: 1;
    height: 52px;
    background: #1A7A7A;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: background 0.2s, transform 0.15s;
}

.tbf-btn-confirm:hover { background: #155f5f; transform: translateY(-1px); }

/* ============================================================
   STEP 4 – PAYMENT PLACEHOLDER
   ============================================================ */
.tbf-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid #e0e0e0;
}

.tbf-total-label,
.tbf-total-amount { font-family: 'Lora', Georgia, serif; font-size: 17px; font-weight: 700; color: #1a1a1a; }

.tbf-payment-placeholder {
    border: 2px dashed #d0e8e8;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.tbf-payment-placeholder-icon { margin-bottom: 16px; }

.tbf-payment-placeholder-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A7A7A;
    margin-bottom: 8px;
}

.tbf-payment-placeholder-note {
    font-size: 13px;
    color: #888;
}

/* ============================================================
   PAYMENT RESULT PAGES (success / cancel return from Stripe)
   ============================================================ */
.tbf-payment-result {
    background: #fff;
    border-radius: 16px;
    padding: 50px 32px 40px;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.tbf-payment-result-icon { margin-bottom: 20px; }

.tbf-payment-result-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
}

.tbf-payment-result-message {
    font-size: 15px;
    color: #555;
    line-height: 1.65;
    margin: 0 0 12px;
}

.tbf-payment-result-note {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.tbf-payment-result-note .tbf-btn-next {
    margin-top: 18px;
    width: auto;
    padding: 0 32px;
}

/* ============================================================
   SUCCESS MODAL
   ============================================================ */
.tbf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tbf-fade-in 0.25s ease;
}

.tbf-modal {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px 36px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    animation: tbf-pop-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes tbf-pop-in {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.tbf-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.tbf-modal-close:hover { color: #333; }
.tbf-modal-icon { width: 68px; height: 68px; margin: 0 auto 18px; }
.tbf-modal-icon svg { width: 100%; height: 100%; }

.tbf-modal-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.tbf-modal-message { font-size: 14px; color: #555; line-height: 1.65; }

/* ============================================================
   SPINNER
   ============================================================ */
.tbf-spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbf-spinner {
    width: 42px; height: 42px;
    border: 4px solid #d0e8e8;
    border-top-color: #1A7A7A;
    border-radius: 50%;
    animation: tbf-spin 0.7s linear infinite;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet breakpoint — stacks 2-col rows into single column */
@media (max-width: 640px) {
    .tbf-wrapper { padding: 0 16px 40px; }
    .tbf-row { grid-template-columns: 1fr; gap: 12px; }
    .tbf-confirm-actions { flex-direction: column; }
}

/* Mobile breakpoint — tighter spacing */
@media (max-width: 520px) {
    .tbf-wrapper { padding: 0 10px 32px; }
    .tbf-steps-bar { padding: 14px 12px 16px; margin-bottom: 24px; }
    .tbf-step-label { font-size: 10px; }
    .tbf-step-circle { width: 36px; height: 36px; font-size: 12px; }
    .tbf-step-connector { min-width: 20px; margin-bottom: 20px; }
    .tbf-register-for { gap: 12px; flex-direction: column; align-items: flex-start; }
    .tbf-radio-group { margin-left: 0; }
    .tbf-register-label { font-size: 18px; }
    .tbf-section-title { font-size: 19px; margin-bottom: 16px; }
    .tbf-row { margin-bottom: 12px; }
    .tbf-field input[type="text"],
    .tbf-field input[type="email"],
    .tbf-field input[type="tel"],
    .tbf-field input[type="number"],
    .tbf-field input[type="date"],
    .tbf-field textarea,
    .tbf-select-wrap select { height: auto; min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }
    .tbf-btn-next,
    .tbf-btn-edit,
    .tbf-btn-confirm { height: 48px; font-size: 15px; }
    .tbf-modal { padding: 32px 20px 28px; }
    .tbf-modal-title { font-size: 19px; }
    .tbf-payment-result { padding: 36px 20px 28px; }
    .tbf-payment-result-title { font-size: 20px; }
}

/* ============================================================
   COUPON SECTION
   ============================================================ */
.tbf-coupon-section {
    margin-bottom: 20px;
}

.tbf-coupon-toggle-btn {
    background: none;
    border: none;
    color: #1A7A7A;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.tbf-coupon-toggle-btn:hover {
    color: #155f5f;
}

.tbf-coupon-form {
    margin-top: 12px;
}

.tbf-coupon-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tbf-coupon-input {
    flex: 1;
    height: 44px;
    border: 1.5px solid #d8e8e8;
    border-radius: 8px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tbf-coupon-input:focus {
    border-color: #1A7A7A;
    box-shadow: 0 0 0 3px rgba(26,122,122,0.12);
}

.tbf-coupon-input:disabled {
    background: #f5f5f5;
    color: #888;
}

.tbf-coupon-apply-btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background: #1A7A7A;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.tbf-coupon-apply-btn:hover {
    background: #155f5f;
}

.tbf-coupon-apply-btn:disabled {
    background: #b5d5d5;
    cursor: default;
}

.tbf-coupon-message {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}

.tbf-coupon-success {
    color: #46b450;
    font-weight: 600;
}

.tbf-coupon-error {
    color: #e53e3e;
    font-weight: 500;
}

/* ============================================================
   PRICE BREAKDOWN
   ============================================================ */
.tbf-price-breakdown {
    border: 1.5px solid #d0e8e8;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: #f9fdfd;
}

.tbf-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.tbf-price-row + .tbf-price-row {
    border-top: 1px solid #e8f0f0;
}

.tbf-price-label {
    font-size: 14px;
    color: #555;
}

.tbf-price-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.tbf-discount-value {
    color: #46b450;
}

.tbf-total-row {
    border-top: 2px solid #d0e8e8 !important;
    padding-top: 12px;
}

.tbf-total-row .tbf-price-label,
.tbf-total-row .tbf-price-value {
    font-family: 'Lora', Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
}
