/* Bayside Facility Billing — Frontend Styles v2.3 */
/* Design system shared with email templates: gradient hero, soft-blue info pills, yellow dividers, brand-blue CTAs. */
/* Roboto font is enqueued separately via wp_enqueue_style in class-bfb-frontend.php. */

/* ----- Outer container ----- */
.bfb-wrap {
	width: 100%;
	max-width: 1368px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: 'Roboto', Arial, Helvetica, sans-serif;
	color: #344054;
}

.bfb-wrap * { box-sizing: border-box; }

/* ----- Group switcher ----- */
.bfb-group-switcher {
	padding: 28px 48px 0;
	display: flex;
	align-items: center;
	gap: 14px;
}
.bfb-switcher-label {
	font-size: 12px;
	font-weight: 700;
	color: #667085;
	text-transform: uppercase;
	letter-spacing: .7px;
	white-space: nowrap;
}
.bfb-group-select {
	flex: 1;
	max-width: 380px;
	appearance: none;
	-webkit-appearance: none;
	background: #ffffff;
	border: 1.5px solid #dbe7f5;
	border-radius: 14px;
	padding: 14px 44px 14px 18px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	color: #0b3f92;
	cursor: pointer;
	line-height: 1.4;
	height: auto;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230b3f92' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
}
.bfb-group-select:focus {
	outline: none;
	border-color: #0b4ea2;
	box-shadow: 0 0 0 3px rgba(11,78,162,.15);
}

/* ----- Main card ----- */
.bfb-card {
	background: #ffffff;
	border-radius: 28px;
	overflow: hidden;
	margin-top: 24px;
	width: 100%;
}

/* ----- Header (gradient hero) ----- */
.bfb-card-header {
	margin: 28px 48px 0;
	border-radius: 24px;
	overflow: hidden;
	background: #0b3f92;
	background-image: linear-gradient(135deg, #092b7a 0%, #0b4ea2 52%, #0796cf 100%);
	color: #ffffff;
	padding: 40px 44px 34px;
}

.bfb-header-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.bfb-header-pill {
	display: inline-block;
	background: rgba(255,255,255,.16);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .7px;
	text-transform: uppercase;
	padding: 8px 14px;
	border-radius: 999px;
}

.bfb-card-title {
	margin: 14px 0 0;
	font-size: 34px;
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: -.4px;
	color: #ffffff;
}

.bfb-card-subtitle {
	margin: 10px 0 0;
	color: #eaf5ff;
	font-size: 15px;
	line-height: 1.6;
}
.bfb-card-subtitle strong { color: #ffffff; }

/* Status badge inside the hero — translucent with a colored dot */
.bfb-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,.18);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	padding: 7px 12px;
	border-radius: 999px;
	white-space: nowrap;
	flex-shrink: 0;
}
.bfb-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74,222,128,.25);
	display: inline-block;
}
.bfb-status-due_soon .bfb-status-dot { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.25); }
.bfb-status-overdue  .bfb-status-dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.25); }
.bfb-status-drafted  .bfb-status-dot { background: #cbd5e1; box-shadow: 0 0 0 3px rgba(203,213,225,.25); }
.bfb-status-no_date  .bfb-status-dot { background: #cbd5e1; box-shadow: 0 0 0 3px rgba(203,213,225,.25); }

/* Subtle stats baked into the bottom of the hero */
.bfb-header-stats {
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px solid rgba(255,255,255,.18);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
.bfb-stat-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .7px;
	text-transform: uppercase;
	color: rgba(255,255,255,.65);
	margin-bottom: 4px;
}
.bfb-stat-value {
	display: block;
	font-size: 24px;
	font-weight: 900;
	color: #ffffff;
	letter-spacing: -.3px;
}

/* ----- Alert (drafted / interrupted) ----- */
.bfb-alert {
	margin: 28px 48px 0;
	border-radius: 14px;
	padding: 18px 22px;
	font-size: 14px;
	line-height: 1.6;
}
.bfb-alert-danger {
	background: #fef2f2;
	border-left: 4px solid #f87171;
	color: #7f1d1d;
}
.bfb-alert-danger strong { color: #b91c1c; }
.bfb-alert-info {
	background: #f7fbff;
	border-left: 4px solid #0b4ea2;
	color: #0b3f92;
}

/* ----- Subtle divider (replaces the old yellow rule) ----- */
.bfb-divider {
	height: 0;
	border-top: 1px solid #dbe7f5;
	margin: 36px 48px;
}

/* ----- Side-by-side actions ----- */
.bfb-actions {
	padding: 0 48px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 72px;
	align-items: stretch;
	position: relative;
}
.bfb-actions::before {
	content: '';
	position: absolute;
	top: -36px;
	bottom: -36px;
	left: 50%;
	width: 1px;
	background: #dbe7f5;
	transform: translateX(-0.5px);
	pointer-events: none;
}
/* Legacy divider element — hidden; replaced by the ::before line */
.bfb-panel-divider { display: none; }

.bfb-action-block {
	display: flex;
	flex-direction: column;
}
/* Buttons anchored to the bottom of each column → always parallel */
.bfb-action-block > .bfb-btn,
.bfb-action-block > a.bfb-btn {
	margin-top: auto;
}

.bfb-panel-label {
	display: inline-block;
	background: #eaf2ff;
	color: #0b3f92;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .7px;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 999px;
	margin-bottom: 12px;
}
.bfb-panel-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 900;
	color: #0b3f92;
	letter-spacing: -.2px;
	line-height: 1.3;
}
.bfb-action-block p {
	margin: 0 0 18px;
	font-size: 14.5px;
	line-height: 1.6;
	color: #344054;
}

/* Charge preview & seats-row share min-height so buttons align */
.bfb-charge-preview,
.bfb-seats-input-row {
	background: #f7fbff;
	border-radius: 16px;
	padding: 18px 20px;
	margin-bottom: 18px;
	min-height: 96px;
}
.bfb-charge-preview {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.bfb-seats-input-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.bfb-charge-amount {
	display: block;
	font-size: 28px;
	font-weight: 900;
	color: #0b3f92;
	letter-spacing: -.4px;
	line-height: 1.1;
}
.bfb-charge-card {
	display: block;
	font-size: 13px;
	color: #667085;
	font-weight: 500;
	margin-top: 6px;
}
.bfb-charge-card strong { color: #0b3f92; font-weight: 700; }

.bfb-seats-qty {
	width: 78px !important;
	max-width: 78px !important;
	flex-shrink: 0;
	padding: 10px 12px;
	border: 1.5px solid #dbe7f5;
	border-radius: 12px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #0b3f92;
	text-align: center;
	background: #ffffff;
	box-sizing: border-box;
}
.bfb-seats-qty:focus {
	outline: none;
	border-color: #0b4ea2;
	box-shadow: 0 0 0 3px rgba(11,78,162,.15);
}
.bfb-seats-preview { font-size: 15px; color: #667085; }
.bfb-seats-total {
	font-size: 22px;
	font-weight: 900;
	color: #0b3f92;
	margin-left: 6px;
	letter-spacing: -.2px;
}

/* ----- Buttons ----- */
.bfb-btn {
	display: inline-block;
	width: 100%;
	text-align: center;
	border: none;
	cursor: pointer;
	font-family: inherit;
	text-decoration: none;
	border-radius: 14px;
	padding: 15px 24px;
	font-size: 15px;
	font-weight: 900;
	letter-spacing: .2px;
	transition: transform .1s ease, box-shadow .15s ease;
	box-sizing: border-box;
	line-height: 1.3;
}
.bfb-btn-primary {
	background: #0b3f92;
	background-image: linear-gradient(135deg, #092b7a 0%, #0b4ea2 52%, #0796cf 100%);
	color: #ffffff !important;
	box-shadow: 0 6px 18px rgba(11,78,162,.25);
}
.bfb-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(11,78,162,.32);
	text-decoration: none;
}
.bfb-btn-secondary {
	background: #ffffff;
	color: #0b3f92 !important;
	border: 1.5px solid #0b4ea2;
}
.bfb-btn-secondary:hover {
	background: #f7fbff;
	text-decoration: none;
}
.bfb-btn-ghost {
	background: transparent;
	color: #667085 !important;
	border: 1.5px solid #dbe7f5;
}
.bfb-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
}

/* Loading state for AJAX */
.bfb-btn.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}
.bfb-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: bfb-spin .7s linear infinite;
}
.bfb-btn-secondary.loading::after { border-color: rgba(11,78,162,.3); border-top-color: #0b4ea2; }
@keyframes bfb-spin { to { transform: rotate(360deg); } }

/* ----- Payment history ----- */
.bfb-log {
	padding: 0 48px;
}
.bfb-log h3 {
	margin: 0 0 18px;
	font-size: 18px;
	font-weight: 800;
	color: #0b3f92;
}
.bfb-log-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.bfb-log-table thead th {
	padding: 12px 0;
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: #667085;
	border-bottom: 2px solid #dbe7f5;
}
.bfb-log-table tbody td {
	padding: 14px 0;
	border-bottom: 1px solid #dbe7f5;
	color: #344054;
}
.bfb-log-table tbody tr:last-child td { border-bottom: none; }
.bfb-log-table td.bfb-log-amount {
	font-weight: 700;
	color: #0b3f92;
}

/* ----- Footer ----- */
.bfb-footer {
	padding: 28px 48px 36px;
	text-align: center;
	border-top: 1px solid #dbe7f5;
	margin-top: 8px;
}
.bfb-footer p { margin: 0; font-size: 13px; color: #667085; }
.bfb-footer a { color: #0b4ea2; font-weight: 700; text-decoration: none; }
.bfb-footer a:hover { text-decoration: underline; }

/* ----- Notice / login prompt ----- */
.bfb-notice {
	padding: 18px 22px;
	background: #f7fbff;
	border-radius: 16px;
	color: #0b3f92;
	font-size: 15px;
}
.bfb-notice a { color: #0b4ea2; font-weight: 700; }

/* ----- Modal ----- */
.bfb-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(11,63,146,.45);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.bfb-modal-inner {
	background: #ffffff;
	border-radius: 24px;
	padding: 32px;
	max-width: 480px;
	width: 100%;
	box-shadow: 0 20px 60px rgba(11,63,146,.3);
}
.bfb-modal-title {
	font-size: 22px;
	font-weight: 900;
	color: #0b3f92;
	margin: 0 0 12px;
	letter-spacing: -.3px;
}
.bfb-modal-body {
	color: #344054;
	font-size: 14.5px;
	line-height: 1.7;
}
.bfb-modal-body strong { color: #0b3f92; font-weight: 700; }
.bfb-modal-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}
.bfb-modal-actions .bfb-btn { flex: 1; }
.bfb-modal-result {
	margin-top: 16px;
	padding: 14px 18px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.6;
}
.bfb-modal-result.success {
	background: #dcfce7;
	color: #15803d;
}
.bfb-modal-result.error {
	background: #fef2f2;
	color: #b91c1c;
}

/* ----- Responsive ----- */
@media (max-width: 760px) {
	.bfb-group-switcher,
	.bfb-card-header,
	.bfb-alert,
	.bfb-actions,
	.bfb-log,
	.bfb-footer {
		padding-left: 24px;
		padding-right: 24px;
		margin-left: 0;
		margin-right: 0;
	}
	.bfb-card-header {
		margin-top: 22px;
		padding: 30px 24px 28px;
		border-radius: 18px;
	}
	.bfb-divider {
		margin-left: 24px;
		margin-right: 24px;
		margin-top: 28px;
		margin-bottom: 28px;
	}
	.bfb-card-title { font-size: 26px; }
	.bfb-stat-value { font-size: 20px; }
	.bfb-header-stats { gap: 14px; }

	.bfb-actions {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.bfb-actions::before { display: none; }
	.bfb-actions > .bfb-action-block:first-child {
		padding-bottom: 28px;
		margin-bottom: 28px;
		border-bottom: 1px solid #dbe7f5;
	}
}

@media (max-width: 480px) {
	.bfb-header-stats { grid-template-columns: 1fr 1fr; }
}
