.tvgen-app {
	--tvgen-primary: #6366f1;
	--tvgen-primary-2: #8b5cf6;
	--tvgen-accent: #fbbf24;
	--tvgen-success: #22c55e;
	--tvgen-warning: #f59e0b;
	--tvgen-danger: #f87171;
	--tvgen-bg: #11121a;
	--tvgen-bg-2: #1b1d2b;
	--tvgen-card-bg: rgba(255, 255, 255, 0.045);
	--tvgen-border: rgba(255, 255, 255, 0.09);
	--tvgen-text: #f3f4f6;
	--tvgen-muted: #9aa0b4;
	--tvgen-radius: 14px;
	--tvgen-radius-sm: 10px;
	--tvgen-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);

	max-width: 480px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--tvgen-text);
	box-sizing: border-box;
	background: radial-gradient(120% 120% at 0% 0%, #1f2138 0%, var(--tvgen-bg) 55%, #0b0c12 100%);
	border-radius: 24px;
	padding: 28px 22px;
	box-shadow: var(--tvgen-shadow);
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.tvgen-app::before {
	content: "";
	position: absolute;
	inset: -40% -40% auto auto;
	width: 320px;
	height: 320px;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0) 70%);
	z-index: -1;
	pointer-events: none;
}

.tvgen-app::after {
	content: "";
	position: absolute;
	inset: auto auto -40% -30%;
	width: 320px;
	height: 320px;
	background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(139, 92, 246, 0) 70%);
	z-index: -1;
	pointer-events: none;
}

.tvgen-app *,
.tvgen-app *::before,
.tvgen-app *::after {
	box-sizing: inherit;
}

/* Loading */

.tvgen-loading {
	text-align: center;
	color: var(--tvgen-muted);
	padding: 40px 0;
	font-size: 14px;
}

.tvgen-spinner {
	width: 28px;
	height: 28px;
	margin: 0 auto 12px;
	border: 3px solid var(--tvgen-border);
	border-top-color: var(--tvgen-primary);
	border-radius: 50%;
	animation: tvgen-spin 0.8s linear infinite;
}

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

/* Header / brand */

.tvgen-header {
	text-align: center;
	margin-bottom: 22px;
}

.tvgen-header-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.04));
	border: 1px solid rgba(251, 191, 36, 0.35);
	color: var(--tvgen-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 999px;
	margin-bottom: 12px;
}

.tvgen-header-title {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 4px;
	background: linear-gradient(135deg, #ffffff 0%, #c7c9f5 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.tvgen-header-subtitle {
	font-size: 13px;
	color: var(--tvgen-muted);
	margin: 0;
}

/* Tabs */

.tvgen-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 18px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--tvgen-border);
	border-radius: 999px;
	padding: 4px;
}

.tvgen-tab {
	flex: 1;
	background: none;
	border: none;
	padding: 10px 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--tvgen-muted);
	cursor: pointer;
	border-radius: 999px;
	transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tvgen-tab.is-active {
	color: #fff;
	background: linear-gradient(135deg, var(--tvgen-primary), var(--tvgen-primary-2));
	box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.7);
}

/* Card */

.tvgen-card {
	background: var(--tvgen-card-bg);
	border: 1px solid var(--tvgen-border);
	border-radius: var(--tvgen-radius);
	padding: 22px;
	backdrop-filter: blur(10px);
}

/* Fields */

.tvgen-field {
	margin-bottom: 16px;
}

.tvgen-field label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--tvgen-muted);
	margin-bottom: 8px;
}

.tvgen-field input,
.tvgen-field select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--tvgen-border);
	border-radius: var(--tvgen-radius-sm);
	font-size: 15px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--tvgen-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tvgen-field input::placeholder {
	color: var(--tvgen-muted);
}

.tvgen-field input:focus,
.tvgen-field select:focus {
	outline: none;
	border-color: var(--tvgen-primary);
	background: rgba(255, 255, 255, 0.05);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.tvgen-password-wrapper {
	position: relative;
}

.tvgen-password-wrapper input {
	padding-right: 52px;
}

.tvgen-password-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--tvgen-muted);
	font-size: 12px;
	font-weight: 700;
	padding: 6px 8px;
	border-radius: 8px;
	transition: color 0.2s ease, background 0.2s ease;
}

.tvgen-password-toggle:hover {
	color: var(--tvgen-text);
	background: rgba(255, 255, 255, 0.06);
}

/* Product toggle */

.tvgen-product-toggle {
	display: flex;
	gap: 8px;
}

.tvgen-product-toggle button {
	flex: 1;
	padding: 12px;
	border: 1px solid var(--tvgen-border);
	border-radius: var(--tvgen-radius-sm);
	background: rgba(255, 255, 255, 0.03);
	color: var(--tvgen-text);
	cursor: pointer;
	font-weight: 700;
	font-size: 14px;
	transition: all 0.2s ease;
}

.tvgen-product-toggle button.is-active {
	background: linear-gradient(135deg, var(--tvgen-primary), var(--tvgen-primary-2));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.7);
}

/* Honeypot */

.tvgen-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Submit */

.tvgen-submit {
	width: 100%;
	padding: 14px;
	border: none;
	border-radius: var(--tvgen-radius-sm);
	background: linear-gradient(135deg, var(--tvgen-primary), var(--tvgen-primary-2));
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 10px 25px -10px rgba(99, 102, 241, 0.8);
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.tvgen-submit:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.9);
}

.tvgen-submit:active:not(:disabled) {
	transform: translateY(0);
}

.tvgen-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: none;
}

/* Error / notice */

.tvgen-error {
	background: rgba(248, 113, 113, 0.1);
	border: 1px solid rgba(248, 113, 113, 0.35);
	color: #fecaca;
	border-radius: var(--tvgen-radius-sm);
	padding: 12px 14px;
	font-size: 13px;
	margin-bottom: 14px;
}

.tvgen-notice {
	background: rgba(251, 191, 36, 0.1);
	border: 1px solid rgba(251, 191, 36, 0.35);
	border-radius: var(--tvgen-radius-sm);
	padding: 12px 14px;
	font-size: 13px;
	margin-top: 10px;
	color: #fde68a;
	line-height: 1.5;
}

/* Result */

.tvgen-result {
	margin-top: 18px;
	animation: tvgen-fade-in 0.35s ease;
}

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

.tvgen-result-success {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.3);
	border-radius: var(--tvgen-radius-sm);
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 13px;
	font-weight: 700;
	color: #bbf7d0;
}

.tvgen-result-success svg {
	flex-shrink: 0;
	color: var(--tvgen-success);
}

.tvgen-result-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--tvgen-border);
	font-size: 14px;
	gap: 12px;
}

.tvgen-result-row:last-of-type {
	border-bottom: none;
}

.tvgen-result-row > span:first-child {
	color: var(--tvgen-muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	flex-shrink: 0;
}

.tvgen-result-row .tvgen-value {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	font-size: 14px;
	font-weight: 700;
	word-break: break-all;
	text-align: right;
}

/* Copy button */

.tvgen-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--tvgen-border);
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 700;
	color: var(--tvgen-text) !important;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.tvgen-copy-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}

/* Badges */

.tvgen-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tvgen-badge-iptv {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.08));
	color: #a5b4fc;
	border: 1px solid rgba(99, 102, 241, 0.3);
}

.tvgen-badge-p2p {
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.08));
	color: #d8b4fe;
	border: 1px solid rgba(139, 92, 246, 0.3);
}

.tvgen-badge-active {
	background: rgba(34, 197, 94, 0.12);
	color: #86efac;
	border: 1px solid rgba(34, 197, 94, 0.3);
}

.tvgen-badge-expiring {
	background: rgba(245, 158, 11, 0.12);
	color: #fcd34d;
	border: 1px solid rgba(245, 158, 11, 0.3);
}

.tvgen-badge-expired {
	background: rgba(248, 113, 113, 0.12);
	color: #fca5a5;
	border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Trial card */

.tvgen-trial-card {
	background: var(--tvgen-card-bg);
	border: 1px solid var(--tvgen-border);
	border-radius: var(--tvgen-radius);
	padding: 18px;
	margin-bottom: 14px;
	backdrop-filter: blur(10px);
}

.tvgen-trial-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
	gap: 8px;
	flex-wrap: wrap;
}

.tvgen-link {
	color: #a5b4fc !important;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
}

/* Action buttons */

.tvgen-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

.tvgen-btn-whatsapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background: linear-gradient(135deg, #25d366, #128c7e);
	color: #fff !important;
	padding: 12px;
	border-radius: var(--tvgen-radius-sm);
	font-weight: 800;
	font-size: 14px;
	text-decoration: none;
	box-shadow: 0 10px 25px -10px rgba(37, 211, 102, 0.7);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tvgen-btn-whatsapp:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 30px -10px rgba(37, 211, 102, 0.85);
}

.tvgen-btn-secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--tvgen-border);
	padding: 12px;
	border-radius: var(--tvgen-radius-sm);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	color: var(--tvgen-text) !important;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tvgen-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
	transform: translateY(-1px);
}

.tvgen-actions-row {
	display: flex;
	gap: 10px;
	width: 100%;
	padding-top: 12px;
}

.tvgen-actions-row > a,
.tvgen-actions-row > button {
	flex: 1;
	margin: 0;
	min-width: 0;
}

.tvgen-actions-row .tvgen-btn-secondary span {
	flex-shrink: 0;
}

/* Logout */

.tvgen-logout {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 14px auto;
	background: none;
	border: none;
	color: var(--tvgen-muted) !important;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: color 0.2s ease;
}

.tvgen-logout:hover {
	color: var(--tvgen-text) !important;
}

/* Pagination */

.tvgen-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 18px;
}

.tvgen-pagination button {
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid var(--tvgen-border);
	border-radius: var(--tvgen-radius-sm);
	background: rgba(255, 255, 255, 0.03);
	color: var(--tvgen-text) !important;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tvgen-pagination button:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
}

.tvgen-pagination button.is-active {
	background: linear-gradient(135deg, var(--tvgen-primary), var(--tvgen-primary-2));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.7);
}

.tvgen-pagination button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Empty state */

.tvgen-empty {
	text-align: center;
	color: var(--tvgen-muted);
	padding: 32px 0;
	font-size: 14px;
}

/* Small screens */

@media (max-width: 360px) {
	.tvgen-app {
		padding: 20px 14px;
		border-radius: 18px;
	}

	.tvgen-header-title {
		font-size: 20px;
	}
}
