/* FBIN Tickets — Frontend Widget */

.fbin-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto;
}

/* ─── Step indicator ─────────────────────────────────────────────────────── */

.ft-steps {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}

.ft-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.ft-step.active .ft-step-num {
    background: #48ab00;
    color: #fff;
}
.ft-step.active {
    color: #48ab00;
}
.ft-step.done .ft-step-num {
    background: #10b981;
    color: #fff;
}
.ft-step.done {
    color: #10b981;
    cursor: pointer;
}
.ft-step.done:hover .ft-step-num {
    background: #0d9e6a;
}
.ft-step.done:hover {
    color: #0d9e6a;
}

.ft-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.ft-step-divider {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 6px;
}

/* ─── Panel ──────────────────────────────────────────────────────────────── */

.ft-panel-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #111;
}

.ft-event-meta {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}
.ft-sep { margin: 0 6px; }

/* ─── Ticket list ────────────────────────────────────────────────────────── */

.ft-ticket-list {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.ft-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.ft-ticket-item:last-child { border-bottom: none; }
.ft-ticket-item:hover { background: #fafafa; }
.ft-ticket-item.is-soldout { opacity: 0.55; }

.ft-ticket-info { flex: 1; }

.ft-ticket-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.ft-ticket-price {
    font-size: 16px;
    font-weight: 700;
    color: #48ab00;
}

.ft-ticket-avail {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.ft-ticket-status {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}
.ft-soldout  { color: #ef4444; }
.ft-inactive { color: #f59e0b; }

.ft-ticket-info-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 5px;
    line-height: 1.45;
}

/* ─── Qty control ────────────────────────────────────────────────────────── */

.ft-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-qty-control.is-disabled { opacity: 0.4; pointer-events: none; }
.ft-disabled-label { font-size: 18px; color: #d1d5db; }

.ft-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #374151;
    padding: 0;
}
.ft-qty-btn:hover { border-color: #48ab00; color: #48ab00; background: #f4fbe8; }
.ft-qty-btn:disabled { opacity: 0.4; cursor: default; }

.ft-qty-input {
    width: 42px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
}
.ft-qty-input::-webkit-inner-spin-button,
.ft-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ─── Discount ───────────────────────────────────────────────────────────── */

.ft-discount-row {
    margin: 16px 0;
}

.ft-discount-input-wrap {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.ft-discount-input-wrap input {
    flex: 1;
}

.ft-discount-msg {
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.ft-discount-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fae6;
    border: 1px solid #b3e48a;
    color: #2d7a00;
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 13px;
    font-weight: 600;
}

.ft-discount-saving {
    font-weight: 400;
    color: #3d9200;
}

.ft-discount-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    display: flex;
    align-items: center;
}
.ft-discount-remove:hover {
    color: #ef4444;
}

/* ─── Total ──────────────────────────────────────────────────────────────── */

.ft-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-top: 2px solid #e5e7eb;
    margin-top: 8px;
    font-size: 15px;
    color: #374151;
}

.ft-total-display {
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

/* ─── Fields ─────────────────────────────────────────────────────────────── */

.ft-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.ft-req { color: #ef4444; }

.ft-field {
    margin-bottom: 14px;
}

.ft-field input[type="text"],
.ft-field input[type="email"],
.ft-field input[type="number"],
.ft-field select,
.ft-billing-section input[type="text"],
.ft-billing-section input[type="email"],
.ft-billing-section select {
    display: block;
    width: 100%;
    padding: 9px 12px;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    background: #fff;
    color: #111;
    opacity: 1;
    visibility: visible;
}

.ft-field select,
.ft-billing-section select {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    cursor: pointer;
}
.ft-field input:focus,
.ft-field select:focus,
.ft-billing-section input:focus,
.ft-billing-section select:focus {
    outline: none;
    border-color: #48ab00;
    box-shadow: 0 0 0 3px rgba(72,171,0,0.1);
}
.ft-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.15) !important;
}

.ft-field-row {
    display: flex;
    gap: 12px;
}
.ft-field-row--half > * { flex: 1; }
.ft-field-row--third > * { flex: 1; }
.ft-field--narrow { flex: 0 0 120px !important; }
.ft-field--wide   { flex: 1; }

/* ─── Attendee block ─────────────────────────────────────────────────────── */

.ft-attendee-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}

.ft-attendee-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ft-questions-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.ft-radio-group {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}
.ft-radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    cursor: pointer;
}

/* ─── Billing section ────────────────────────────────────────────────────── */

.ft-billing-section { }

.ft-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #111;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.ft-vat-wrap {
    display: flex;
    gap: 8px;
}
.ft-vat-wrap input { flex: 1; }
.ft-vat-msg {
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

/* ─── Step 4: Summary card ───────────────────────────────────────────────── */

.ft-summary-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 16px;
    background: #fff;
}

.ft-summary {
    /* inner content of .ft-summary-card */
}

.fbin-summary-items {
    margin-bottom: 4px;
}

.fbin-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    font-size: 14px;
    color: #374151;
}

.fbin-summary-label {
    flex: 1;
    padding-right: 16px;
}

.fbin-summary-value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fbin-summary-discount .fbin-summary-label,
.fbin-summary-discount .fbin-summary-value {
    color: #10b981;
    font-weight: 500;
}

.fbin-summary-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.fbin-summary-divider-strong {
    height: 2px;
    background: #d1d5db;
    margin: 10px 0;
}

.fbin-summary-subtotal {
    color: #6b7280;
    font-size: 13px;
}

.fbin-summary-vat {
    color: #6b7280;
    font-size: 13px;
}

.fbin-summary-total .fbin-summary-label,
.fbin-summary-total .fbin-summary-value {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}

/* ─── Step 4: Payment card ───────────────────────────────────────────────── */

.ft-payment-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 16px;
    background: #fff;
}

.ft-payment-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin: 0 0 14px;
}

/* ─── Stripe (legacy wrapper kept for JS compatibility) ──────────────────── */

.ft-stripe-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
    background: #fff;
}

/* ─── Pay button ─────────────────────────────────────────────────────────── */

.ft-btn-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: #48ab00;
    color: #fff;
    transition: background 0.15s;
    line-height: 1;
    gap: 8px;
    margin-bottom: 12px;
}
.ft-btn-pay:hover   { background: #3d9200; }
.ft-btn-pay:active  { background: #357f00; }
.ft-btn-pay:disabled { background: #8fcf66; cursor: default; }

/* ─── Security note ──────────────────────────────────────────────────────── */

.ft-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 16px;
}

/* ─── Invoice note ───────────────────────────────────────────────────────── */

.ft-invoice-note {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.ft-invoice-note .dashicons { font-size: 16px; }

/* ─── Error ──────────────────────────────────────────────────────────────── */

.ft-error-msg {
    color: #ef4444;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* ─── Panel nav ──────────────────────────────────────────────────────────── */

.ft-panel-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.ft-btn-primary,
.ft-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
}

.ft-btn-primary {
    background: #48ab00;
    color: #fff;
}
.ft-btn-primary:hover   { background: #3d9200; }
.ft-btn-primary:disabled { background: #8fcf66; cursor: default; }

.ft-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.ft-btn-secondary:hover { background: #e5e7eb; }

/* ─── Success ────────────────────────────────────────────────────────────── */

.ft-success {
    text-align: center;
    padding: 48px 24px;
}

.ft-success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ft-success h2 {
    font-size: 24px;
    margin: 0 0 10px;
}
.ft-success p { color: #374151; }

/* ─── Soldout banner ─────────────────────────────────────────────────────── */

.ft-soldout-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 18px 22px;
    color: #7f1d1d;
    text-align: center;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
    .ft-steps { gap: 0; }
    .ft-step-lbl { display: none; }
    .ft-field-row { flex-direction: column; }
    .ft-field--narrow { flex: 1; }
    .ft-discount-input-wrap { flex-direction: column; }
    .ft-vat-wrap { flex-direction: column; }
}

/* ─── Event Dashboard container ──────────────────────────────────────────── */

#fbin-events-dashboard {
    display: none;
    min-height: unset !important;
    height: auto !important;
    flex-grow: 0 !important;
    flex: none !important;
    align-self: flex-start !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    padding: 30px 40px !important;
    background: #fff !important;
    box-sizing: border-box;
    overflow: visible;
}

/* Suppress theme pseudo-elements (em-dash decorators on .classic-page-profile) */
#fbin-events-dashboard::before,
#fbin-events-dashboard::after {
    content: none !important;
    display: none !important;
}
#fbin-events-dashboard > *::before,
#fbin-events-dashboard > *::after {
    content: none !important;
    display: none !important;
    border: none !important;
}

/* ─── Event Dashboard base ───────────────────────────────────────────────── */

.fbin-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.5;
}

.fbin-dashboard a {
    color: inherit;
    text-decoration: none;
}

.fbin-dashboard-login { color: #374151; }
.fbin-dashboard-login a { color: #48ab00; }

.fbin-dashboard-empty {
    color: #6b7280;
    font-style: italic;
}

/* ─── Event card ─────────────────────────────────────────────────────────── */

.fbin-dashboard-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.fbin-dashboard-event-card:hover {
    border-color: #48ab00;
    box-shadow: 0 2px 8px rgba(72,171,0,0.1);
}
.fbin-dashboard-event-card:focus {
    outline: 2px solid #48ab00;
    outline-offset: 2px;
}

.fbin-event-card-content { flex: 1; min-width: 0; }

.fbin-event-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
}

.fbin-event-card-date {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.fbin-event-card-status { flex-shrink: 0; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */

.fbin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.fbin-badge-upcoming {
    background: #f0fae6;
    color: #2d7a00;
    border: 1px solid #b3e48a;
}

.fbin-badge-past {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.fbin-dashboard-note {
    font-size: 12px;
    color: #9ca3af;
    margin: 16px 0 0;
}

/* ─── Back button ────────────────────────────────────────────────────────── */

.fbin-dashboard-back {
    background: #48ab00 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 25px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    margin-bottom: 24px;
    line-height: 1;
}
.fbin-dashboard-back:hover {
    background: #3d9100 !important;
    color: #fff !important;
}
.fbin-dashboard-back i {
    color: #fff !important;
    font-size: 16px;
}

/* ─── Dashboard sections ─────────────────────────────────────────────────── */

.fbin-dashboard-section {
    margin-bottom: 28px;
}
.fbin-dashboard-section:last-child {
    margin-bottom: 0;
}

.fbin-section-title {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin: 0 0 14px;
    padding: 0;
    border: none;
}

/* ─── Updates ────────────────────────────────────────────────────────────── */

.fbin-update-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.fbin-update-item:last-child {
    margin-bottom: 0;
}

.fbin-update-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111;
}

.fbin-update-body {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}
.fbin-update-body p { margin: 0 0 8px; }
.fbin-update-body p:last-child { margin-bottom: 0; }

.fbin-update-date {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* ─── Visuals grid ───────────────────────────────────────────────────────── */

.fbin-visuals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.fbin-visual-thumb {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: border-color 0.15s, box-shadow 0.15s;
    aspect-ratio: 1;
}
.fbin-visual-thumb:hover {
    border-color: #48ab00;
    box-shadow: 0 2px 8px rgba(72,171,0,0.12);
}
.fbin-visual-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Dashboard responsive ───────────────────────────────────────────────── */

@media (max-width: 540px) {
    #fbin-events-dashboard { padding: 20px !important; }
    .fbin-dashboard-event-card { flex-direction: column; align-items: flex-start; }
    .fbin-visuals-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ─── Round quantity buttons ─────────────────────────────────────────────── */

.fbin-qty-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid #ddd;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.fbin-qty-btn:hover {
    border-color: #48ab00;
    color: #48ab00;
}
.fbin-qty-btn.is-active {
    background: #48ab00;
    border-color: #48ab00;
    color: #fff;
}
.fbin-qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* ─── Tier system ────────────────────────────────────────────────────────── */

.fbin-ticket-group {
    background: #f9fafb !important;
    border: none !important;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.fbin-ticket-type-header {
    padding: 0 0 10px;
}

.fbin-ticket-type-name {
    font-size: 15px;
    font-weight: 600;
    display: block;
    color: #111827;
}

.fbin-ticket-type-info {
    font-size: 13px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

/* Active tier card */
.fbin-tier-item {
    background: #fff;
    border-left: 3px solid #48ab00;
    border-radius: 0 8px 8px 0;
    margin-left: 8px;
    margin-bottom: 6px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.15s;
}
.fbin-tier-item:last-child {
    margin-bottom: 0;
}
.fbin-tier-item:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Compact one-line layout for unavailable and soldout tiers */
.fbin-tier-item.fbin-tier-unavailable,
.fbin-tier-item.fbin-tier-soldout {
    background: #fff;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 6px;
    border-left: 3px solid #e0e0e0;
    opacity: 0.55;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.fbin-tier-info-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fbin-tier-item.fbin-tier-unavailable .fbin-tier-name,
.fbin-tier-item.fbin-tier-soldout .fbin-tier-name {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.fbin-tier-item.fbin-tier-unavailable .fbin-tier-price-inline,
.fbin-tier-item.fbin-tier-soldout .fbin-tier-price-inline {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.fbin-tier-status {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
}

.fbin-tier-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.fbin-tier-name {
    font-weight: 500;
    font-size: 14px;
    color: #111827;
}

.fbin-tier-price {
    color: #48ab00;
    font-weight: 700;
    font-size: 14px;
}

.fbin-quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fbin-attendee-tier {
    color: #48ab00;
    font-weight: normal;
    font-size: 0.9em;
}

@media (max-width: 480px) {
    .fbin-tier-item:not(.fbin-tier-unavailable):not(.fbin-tier-soldout) {
        flex-direction: column;
        align-items: flex-start;
    }
    .fbin-quantity-selector {
        align-self: flex-end;
    }
}
