/*
 * Razin Pricing Widget — scoped styles (.pw-* prefix).
 * All rules are contained inside .pw-root — zero leakage to the host page.
 * Loaded only on pages that use [razin_pricing_widget].
 */

/* ---- Design tokens ---- */
.pw-root {
	--pw-ink:       #0f0f1f;
	--pw-ink-2:     #475569;
	--pw-mute:      #94a3b8;
	--pw-line:      #e5e7eb;
	--pw-violet:    #7c3aed;
	--pw-emerald:   #059669;

	max-width: 1200px;
	margin: 0 auto;
	color: var(--pw-ink);
	font-family: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}

.pw-root *,
.pw-root *::before,
.pw-root *::after {
	box-sizing: inherit;
}

/* ====================================================================
 * HEADER
 * ==================================================================== */
.pw-header {
	text-align: center;
	margin-bottom: 44px;
}

.pw-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--pw-violet);
	background: rgba(124, 58, 237, 0.08);
	padding: 7px 14px 7px 12px;
	border-radius: 999px;
	margin-bottom: 18px;
}

.pw-eyebrow::before {
	content: "";
	width: 16px;
	height: 1.5px;
	background: var(--pw-violet);
	display: inline-block;
	border-radius: 2px;
}

.pw-title {
	font-family: inherit;
	font-size: clamp(30px, 4.4vw, 48px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.03em;
	margin: 0 0 14px;
}

.pw-title em {
	font-style: italic;
	color: var(--pw-violet);
}

.pw-sub {
	font-size: 16px;
	line-height: 1.6;
	color: var(--pw-ink-2);
	max-width: 540px;
	margin: 0 auto;
}

/* ====================================================================
 * PRODUCT TABS
 * ==================================================================== */
.pw-tabs-wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 auto 45px;
	max-width: 980px;
}

.pw-tab {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px 9px 9px;
	border-radius: 14px;
	background: #ffffff;
	border: 1px solid var(--pw-line);
	cursor: pointer;
	transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--pw-ink-2);
	-webkit-user-select: none;
	user-select: none;
}

.pw-tab:hover {
	transform: translateY(-2px);
	border-color: rgba(124, 58, 237, 0.35);
	box-shadow: 0 6px 18px -8px rgba(15, 15, 31, 0.18);
}

.pw-tab--active {
	background: var(--pw-ink);
	color: #ffffff;
	border-color: var(--pw-ink);
	box-shadow: 0 10px 28px -8px rgba(15, 15, 31, 0.3);
}

.pw-tab--active:hover {
	border-color: var(--pw-ink);
	box-shadow: 0 14px 32px -8px rgba(15, 15, 31, 0.4);
}

.pw-tab__img {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

/* ====================================================================
 * PRICING TABLE — glassmorphism
 * Frosted glass shell; Pro column = saturated blue glass.
 * ==================================================================== */

/* Panel visibility toggle (JS adds/removes pw-plans--hidden) */
.pw-plans--hidden {
	display: none;
}

.pw-plans {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 22px 0 0;
	overflow-y: hidden;
}

@keyframes pw-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Animation lives on .pw-table so the JS re-trigger (style.animation = 'none'
   → reflow → style.animation = '') correctly replays it on every tab switch. */
.pw-table {
	animation: pw-rise 820ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* Glass shell */
.pw-table {
	position: relative;
	min-width: 760px;
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 22px;
	overflow: hidden;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 28px 64px -28px rgba(30, 64, 175, 0.28);
}

/* 4-column grid shared by every row */
.pw-row {
	display: grid;
	grid-template-columns: 1.7fr 1fr 1fr 1.05fr;
	align-items: stretch;
}

.pw-cell {
	position: relative;
	padding: 18px 24px;
	display: flex;
	align-items: center;
	font-size: 14px;
	color: #1e293b;
	transition: background 0.2s ease;
}

/* Pro column tint */
.pw-cell--pro {
	background: rgba(59, 130, 246, 0.08);
}

/* Alternating row tint */
.pw-row--data:nth-child(even) > .pw-cell:not(.pw-cell--pro) {
	background: rgba(15, 23, 42, 0.025);
}
.pw-row--data:nth-child(even) > .pw-cell--pro {
	background: rgba(59, 130, 246, 0.14);
}

/* Row hover */
.pw-row--data:hover > .pw-cell:not(.pw-cell--pro) {
	background: rgba(15, 23, 42, 0.05);
}
.pw-row--data:hover > .pw-cell--pro {
	background: rgba(59, 130, 246, 0.16);
}

/* ---- Header row ---- */
.pw-row-head {
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pw-cell-features-label {
	font-family: inherit;
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
	padding: 36px 28px;
	letter-spacing: -0.02em;
}

.pw-cell-plan-head {
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	padding: 30px 28px 26px;
	background: rgba(255, 255, 255, 0.45);
	gap: 6px;
	min-height: 176px;
	border-right: 1px solid rgba(15, 23, 42, 0.05);
}

.pw-cell-plan-head:last-child {
	border-right: 0;
}

/* Pro header — strong blue glass + room for badge */
.pw-cell-plan-head.pw-cell--pro {
	padding-top: 56px;
	background: linear-gradient(160deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
	color: #ffffff;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.3),
		inset 1px 0 0 rgba(255, 255, 255, 0.1);
}

.pw-plan-name-head {
	font-family: inherit;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.028em;
	color: inherit;
	margin: 0 0 4px;
}

.pw-plan-tag-head {
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	margin: 0 0 18px;
	line-height: 1.45;
	min-height: 36px;
}

.pw-cell-plan-head.pw-cell--pro .pw-plan-tag-head {
	color: rgba(255, 255, 255, 0.92);
}

.pw-plan-price-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-top: auto;
}

.pw-plan-price-head__was {
	font-size: 14px;
	font-weight: 500;
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
	color: #94a3b8;
}

.pw-cell-plan-head.pw-cell--pro .pw-plan-price-head__was {
	color: rgba(255, 255, 255, 0.65);
}

.pw-plan-price-head__now {
	font-family: inherit;
	font-size: 38px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.035em;
	color: inherit;
}

/* ---- "Most Popular" badge — glass pill inside the Pro header ---- */
.pw-badge {
	position: absolute;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.2);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	color: #ffffff;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 6px 14px;
	border-radius: 999px;
	white-space: nowrap;
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.3),
		0 6px 18px -4px rgba(15, 23, 42, 0.22);
}

.pw-badge::before {
	content: "★";
	color: #fcd34d;
	margin-right: 6px;
	font-size: 11px;
	letter-spacing: 0;
}

/* ---- Feature label cell ---- */
.pw-cell-label {
	color: #1e293b;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	padding: 18px 26px;
	border-right: 1px solid rgba(15, 23, 42, 0.05);
}

/* ---- State cell ---- */
.pw-cell-state {
	justify-content: center;
}

.pw-state {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	flex-shrink: 0;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 2px 6px rgba(15, 23, 42, 0.14);
}

.pw-state--inc {
	background: linear-gradient(135deg, #34d399, #10b981);
}

.pw-state--exc {
	background: linear-gradient(135deg, #f87171, #ef4444);
}

.pw-state--par {
	background: linear-gradient(135deg, #34d399, #10b981);
}

.pw-state-note {
	margin-left: 10px;
	font-size: 12.5px;
	font-weight: 500;
	color: #475569;
	white-space: nowrap;
}

/* ---- Footer row (CTAs) ---- */
.pw-row-foot {
	border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.pw-row-foot .pw-cell {
	padding: 26px 24px;
	background: rgba(255, 255, 255, 0.4);
}

.pw-row-foot .pw-cell--pro {
	background: rgba(59, 130, 246, 0.1);
}

.pw-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 13px 18px;
	border-radius: 10px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.005em;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	border: 1.5px solid transparent !important;
	transition: all 0.35s ease;
}

/* Basic + Advance — frosted glass */
.pw-cta--basic,
.pw-cta--advance {
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	color: #1e293b;
	border-color: rgba(255, 255, 255, 0.2);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.4),
		0 1px 2px rgba(15, 23, 42, 0.05)!important;
		transition: all 0.35s ease;
}

.pw-cta--basic:hover,
.pw-cta--advance:hover {
	background: #3b82f6;
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.18);
	transform: translateY(-1px);
	transition: all 0.35s ease;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.1), 
		0 8px 20px -6px rgba(15, 23, 42, 0.4) !important;
}

/* Pro — solid blue gradient */
.pw-cta--pro {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: #ffffff;
	transition: all 0.35s ease;
}

.pw-cta--pro:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	transform: translateY(-2px);
	color: #ffffff;
}

/* ---- Footnote ---- */
.pw-footnote {
	margin-top: 36px;
	text-align: center;
	font-size: 13px;
	color: var(--pw-ink-2);
}

.pw-footnote a {
	color: var(--pw-violet);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

.pw-footnote a:hover {
	border-bottom-color: var(--pw-violet);
}

/* ====================================================================
 * RESPONSIVE
 * ==================================================================== */
@media (max-width: 980px) {
	.pw-plans {
		padding: 22px 4px 0;
	}
	.pw-cell {
		padding: 14px 18px;
		font-size: 13.5px;
	}
	.pw-cell-label {
		padding: 14px 18px;
	}
	.pw-cell-features-label {
		padding: 28px 18px;
		font-size: 18px;
	}
	.pw-cell-plan-head {
		padding: 24px 18px 20px;
		min-height: 150px;
	}
	.pw-cell-plan-head.pw-cell--pro {
		padding-top: 52px;
	}
	.pw-plan-name-head {
		font-size: 24px;
	}
	.pw-plan-price-head__now {
		font-size: 28px;
	}
	.pw-row-foot .pw-cell {
		padding: 20px 18px;
	}
}

@media (max-width: 640px) {
	.pw-tabs-wrap {
		flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: flex-start;
		padding: 4px 16px 16px;
		margin: 0 -16px 32px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.pw-tabs-wrap::-webkit-scrollbar {
		display: none;
	}
	.pw-tab {
		flex-shrink: 0;
	}
	.pw-title {
		font-size: 28px;
	}
}
