/* ── Billing Page Styles ────────────────────────────────��────────── */

.gs-billing-container {
	max-width: 960px;
	margin: 0 auto;
	padding: 40px 24px 80px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gs-billing-loading {
	text-align: center;
	padding: 80px 0;
	color: var(--gs-text-muted);
	font-size: var(--gs-text-base);
}

.gs-billing-heading {
	font-size: 28px;
	font-weight: 700;
	color: var(--gs-navy);
	margin: 0 0 4px;
	letter-spacing: -0.02em;
}

.gs-billing-subtitle {
	font-size: 15px;
	color: var(--gs-text-muted);
	margin: 0 0 32px;
}

/* ── Trial Banner ────────────────────────────────────────────────── */
.gs-trial-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	border-radius: var(--gs-radius);
	margin-bottom: 24px;
	font-size: var(--gs-text-sm);
	line-height: 1.5;
}

.gs-trial-banner--ok {
	background: #e0f7fa;
	border: 1px solid #b2ebf2;
	color: #006064;
}

.gs-trial-banner--warn {
	background: #fff3e0;
	border: 1px solid #ffe0b2;
	color: #e65100;
}

.gs-trial-banner--expired {
	background: #fce4ec;
	border: 1px solid #f8bbd0;
	color: #b71c1c;
}

.gs-trial-banner--canceling {
	background: #fff8e1;
	border: 1px solid #ffecb3;
	color: #f57f17;
}

.gs-trial-banner svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.gs-trial-banner-text {
	flex: 1;
}

.gs-trial-banner-cta {
	background: var(--gs-navy);
	color: #fff;
	border: none;
	padding: 7px 16px;
	border-radius: var(--gs-radius-sm);
	font-size: var(--gs-text-sm);
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--gs-transition-fast);
}

.gs-trial-banner-cta:hover {
	background: #244a6e;
}

/* ── Cards ─────────────────────────────────────────────────────��─── */
.gs-billing-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 32px;
}

.gs-billing-card {
	background: #fff;
	border: 1px solid var(--gs-gray-200);
	border-radius: var(--gs-radius);
	padding: 24px;
	box-shadow: var(--gs-shadow-sm);
}

.gs-billing-card--full {
	grid-column: 1 / -1;
	overflow-x: auto;
}

.gs-billing-card h3 {
	font-size: var(--gs-text-base);
	font-weight: 600;
	color: var(--gs-text-primary);
	margin: 0 0 16px;
}

/* ── Plan Summary ─────────────────────────────��──────────────────── */
.gs-plan-tier {
	font-size: var(--gs-text-2xl);
	font-weight: 700;
	color: var(--gs-navy);
	margin-bottom: 4px;
}

.gs-plan-price {
	font-size: var(--gs-text-lg);
	color: var(--gs-text-secondary);
	margin-bottom: 2px;
}

.gs-plan-cycle {
	font-size: var(--gs-text-sm);
	color: var(--gs-text-muted);
}

.gs-plan-trial-badge {
	display: inline-block;
	background: var(--gs-teal);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 10px;
	border-radius: 12px;
	margin-left: 8px;
	vertical-align: middle;
}

/* ── Usage Dashboard ─────────────────────────────────────────────── */
.gs-usage-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.gs-usage-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.gs-usage-label {
	display: flex;
	justify-content: space-between;
	font-size: var(--gs-text-sm);
	color: var(--gs-text-secondary);
}

.gs-usage-value {
	font-weight: 600;
	color: var(--gs-text-primary);
}

.gs-usage-bar {
	height: 8px;
	background: var(--gs-gray-100);
	border-radius: 4px;
	overflow: hidden;
}

.gs-usage-fill {
	height: 100%;
	border-radius: 4px;
	transition: width var(--gs-transition-slow);
}

.gs-usage-fill--ok {
	background: var(--gs-teal);
}

.gs-usage-fill--amber {
	background: #f59e0b;
}

.gs-usage-fill--red {
	background: #ef4444;
}

/* ── Cost Preview ────────────────────────────────────────────────── */
.gs-cost-rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gs-cost-row {
	display: flex;
	justify-content: space-between;
	font-size: var(--gs-text-sm);
	color: var(--gs-text-secondary);
	padding: 2px 0;
}

.gs-cost-row--total {
	border-top: 1px solid var(--gs-gray-200);
	margin-top: 6px;
	padding-top: 10px;
	font-weight: 700;
	font-size: var(--gs-text-base);
	color: var(--gs-text-primary);
}

.gs-cost-recommend {
	margin-top: 12px;
	padding: 10px 14px;
	background: #e8f5e9;
	border-radius: var(--gs-radius-sm);
	font-size: var(--gs-text-sm);
	color: #2e7d32;
}

/* ── Actions Panel ───────────────────────────────��───────────────── */
.gs-billing-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 32px;
}

.gs-billing-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: var(--gs-radius-sm);
	font-size: var(--gs-text-sm);
	font-weight: 600;
	cursor: pointer;
	transition: all var(--gs-transition-fast);
	border: none;
}

.gs-billing-btn--primary {
	background: var(--gs-navy);
	color: #fff;
}

.gs-billing-btn--primary:hover {
	background: #244a6e;
}

.gs-billing-btn--secondary {
	background: #fff;
	color: var(--gs-navy);
	border: 1px solid var(--gs-gray-300);
}

.gs-billing-btn--secondary:hover {
	background: var(--gs-gray-50);
	border-color: var(--gs-gray-400);
}

.gs-billing-btn--success {
	background: var(--gs-teal);
	color: #fff;
}

.gs-billing-btn--success:hover {
	background: #00838f;
}

.gs-billing-btn svg {
	width: 16px;
	height: 16px;
}

/* ── Plan Selection Grid ─────────────────────────────────────────── */
.gs-billing-section-title {
	font-size: var(--gs-text-lg);
	font-weight: 700;
	color: var(--gs-navy);
	margin: 0 0 8px;
}

.gs-billing-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	font-size: var(--gs-text-sm);
	color: var(--gs-text-secondary);
}

.gs-billing-toggle-track {
	width: 40px;
	height: 22px;
	border-radius: 11px;
	background: var(--gs-gray-300);
	cursor: pointer;
	position: relative;
	transition: background var(--gs-transition-fast);
}

.gs-billing-toggle-track--on {
	background: var(--gs-teal);
}

.gs-billing-toggle-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: var(--gs-shadow-sm);
	position: absolute;
	top: 2px;
	left: 2px;
	transition: left var(--gs-transition-fast);
}

.gs-billing-toggle-track--on .gs-billing-toggle-thumb {
	left: 20px;
}

.gs-plan-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 40px;
}

.gs-plan-card {
	background: #fff;
	border: 2px solid var(--gs-gray-200);
	border-radius: var(--gs-radius);
	padding: 24px 20px;
	text-align: center;
	transition: border-color var(--gs-transition-fast), box-shadow var(--gs-transition-fast);
	display: flex;
	flex-direction: column;
}

.gs-plan-card:hover {
	border-color: var(--gs-teal);
	box-shadow: var(--gs-shadow-md);
}

.gs-plan-card--current {
	border-color: var(--gs-navy);
}

.gs-plan-card-name {
	font-size: var(--gs-text-lg);
	font-weight: 700;
	color: var(--gs-navy);
	margin-bottom: 8px;
}

.gs-plan-card-price {
	font-size: var(--gs-text-3xl);
	font-weight: 700;
	color: var(--gs-text-primary);
	line-height: 1;
	margin-bottom: 4px;
}

.gs-plan-card-period {
	font-size: var(--gs-text-sm);
	color: var(--gs-text-muted);
	margin-bottom: 16px;
}

.gs-plan-card-features {
	list-style: none;
	padding: 0;
	margin: 0 0 20px;
	text-align: left;
	font-size: var(--gs-text-sm);
	color: var(--gs-text-secondary);
	flex: 1;
}

.gs-plan-card-features li {
	padding: 4px 0 4px 20px;
	position: relative;
}

.gs-plan-card-features li::before {
	content: '\2713';
	position: absolute;
	left: 0;
	color: var(--gs-teal);
	font-weight: 700;
}

.gs-plan-card-badge {
	display: inline-block;
	background: var(--gs-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 12px;
	border-radius: 12px;
	margin-bottom: 12px;
}

.gs-plan-card-cta {
	display: block;
	width: 100%;
	padding: 10px 0;
	border-radius: var(--gs-radius-sm);
	font-size: var(--gs-text-sm);
	font-weight: 600;
	cursor: pointer;
	transition: all var(--gs-transition-fast);
	border: none;
	background: var(--gs-teal);
	color: #fff;
}

.gs-plan-card-cta:hover {
	background: #00838f;
}

.gs-plan-card-cta--current {
	background: var(--gs-gray-100);
	color: var(--gs-text-muted);
	cursor: default;
}

.gs-plan-card-cta--current:hover {
	background: var(--gs-gray-100);
}

.gs-plan-card-cta--contact {
	background: var(--gs-navy);
	color: #fff;
}

.gs-plan-card-cta--contact:hover {
	background: #244a6e;
}

/* ── Invoice List ────────────────────────────────────────────────── */
.gs-invoice-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--gs-text-sm);
}

.gs-invoice-table th {
	text-align: left;
	font-weight: 600;
	color: var(--gs-text-muted);
	padding: 8px 12px;
	border-bottom: 2px solid var(--gs-gray-200);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.gs-invoice-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--gs-gray-100);
	color: var(--gs-text-secondary);
}

.gs-invoice-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.gs-invoice-status--paid {
	background: #e8f5e9;
	color: #2e7d32;
}

.gs-invoice-status--open {
	background: #fff3e0;
	color: #e65100;
}

.gs-invoice-status--draft {
	background: var(--gs-gray-100);
	color: var(--gs-text-muted);
}

.gs-invoice-pdf {
	color: var(--gs-teal);
	text-decoration: none;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.gs-invoice-pdf:hover {
	text-decoration: underline;
}

.gs-invoice-empty {
	text-align: center;
	padding: 24px;
	color: var(--gs-text-muted);
	font-size: var(--gs-text-sm);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.gs-billing-grid {
		grid-template-columns: 1fr;
	}

	.gs-plan-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.gs-billing-container {
		padding: 24px 16px 60px;
	}
}

@media (max-width: 480px) {
	.gs-plan-grid {
		grid-template-columns: 1fr;
	}
}

/* ── React Modal ─────────────────────────────────────────────────── */
.gs-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
}

.gs-modal {
	background: #fff;
	border-radius: var(--gs-radius);
	box-shadow: var(--gs-shadow-xl);
	width: 420px;
	max-width: 90vw;
	max-height: 85vh;
	overflow-y: auto;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gs-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 18px 24px 14px;
	border-bottom: 1px solid var(--gs-gray-200);
}

.gs-modal-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--gs-navy);
}

.gs-modal-close {
	background: none;
	border: none;
	font-size: 20px;
	color: var(--gs-text-muted);
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.gs-modal-close:hover {
	color: var(--gs-text-primary);
}

.gs-modal-body {
	padding: 20px 24px;
	font-size: 14px;
	color: var(--gs-text-secondary);
	line-height: 1.6;
}

.gs-modal-body label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--gs-text-primary);
	margin-bottom: 6px;
}

.gs-modal-body input[type="number"] {
	width: 140px;
	padding: 8px 12px;
	border: 1px solid var(--gs-gray-300);
	border-radius: var(--gs-radius-sm);
	font-size: 14px;
	color: var(--gs-text-primary);
}

.gs-modal-body input[type="number"]:focus {
	outline: none;
	border-color: var(--gs-teal);
	box-shadow: 0 0 0 2px rgba(0, 151, 167, 0.15);
}

.gs-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 24px 18px;
	border-top: 1px solid var(--gs-gray-200);
}

.gs-modal-btn {
	padding: 8px 20px;
	border-radius: var(--gs-radius-sm);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--gs-transition-fast);
	border: none;
}

.gs-modal-btn--cancel {
	background: #fff;
	color: var(--gs-text-secondary);
	border: 1px solid var(--gs-gray-300);
}

.gs-modal-btn--cancel:hover {
	background: var(--gs-gray-50);
}

.gs-modal-btn--ok {
	background: var(--gs-navy);
	color: #fff;
}

.gs-modal-btn--ok:hover {
	background: #244a6e;
}

.gs-modal-btn--success {
	background: var(--gs-teal);
	color: #fff;
}

.gs-modal-btn--success:hover {
	background: #00838f;
}

.gs-modal-result {
	margin-top: 12px;
	padding: 12px 16px;
	background: #e8f5e9;
	border-radius: var(--gs-radius-sm);
	font-size: 14px;
	color: #2e7d32;
	font-weight: 600;
}
