/**
 * TutorBridgePro release polish.
 *
 * Final cross-page visual contract. Loaded after page styles so spacing,
 * responsive behavior, dark mode and floating-control safe areas stay
 * consistent without changing page functionality.
 */

:root {
	--tbp-release-content: 76rem;
	--tbp-release-reading: 48rem;
	--tbp-release-section: clamp(3.5rem, 7vw, 6rem);
	--tbp-release-radius: 1.25rem;
	--tbp-release-field: 3.25rem;
	--tbp-release-safe-bottom: 5.5rem;
}

html {
	scroll-padding-top: 7rem;
}

body {
	overflow-x: clip;
}

.tbp-container {
	width: min(calc(100% - clamp(2rem, 6vw, 5rem)), var(--tbp-release-content));
}

:where(button, a, input, select, textarea):focus-visible {
	outline: 3px solid rgb(18 120 231 / 32%);
	outline-offset: 3px;
}

:where(input:not([type="checkbox"], [type="radio"]), select, textarea) {
	max-width: 100%;
}

/* Keep third-party floating controls clear of real content. */
main:last-of-type,
.site-footer {
	scroll-margin-bottom: var(--tbp-release-safe-bottom);
}

.primary-menu .tbp-menu-support-gaza > a::before,
.mobile-menu .tbp-menu-support-gaza > a::before {
	content: "\2665";
}

/* Shared product heroes: strong, compact and balanced in both directions. */
.tbp-product-hero__inner {
	max-width: var(--tbp-release-content);
	padding-block: clamp(3rem, 6vw, 5.25rem);
}

.tbp-product-hero h1 {
	max-width: 19ch;
	font-size: clamp(2.35rem, 4.6vw, 4rem);
	line-height: 1.07;
	text-wrap: balance;
}

.tbp-product-hero__lead {
	max-width: 58ch;
	font-size: clamp(1rem, 1.4vw, 1.14rem);
}

/* Homepage: one dominant hero followed by a clearly separated search task. */
.tbp-v2-hero {
	min-height: auto;
	padding-block: clamp(4rem, 7vw, 6.5rem) clamp(7rem, 10vw, 9rem);
}

.tbp-v2-hero__inner {
	gap: clamp(2.5rem, 5vw, 4.5rem);
	grid-template-columns: minmax(0, 1.03fr) minmax(22rem, .97fr);
}

.tbp-v2-hero h1 {
	max-width: 12ch;
	font-size: clamp(3rem, 5vw, 5rem);
	line-height: 1;
	text-wrap: balance;
}

.tbp-v2-hero__copy > p:not(.tbp-v2-eyebrow) {
	max-width: 58ch;
	margin-block: 1.5rem 1.75rem;
}

.tbp-v2-hero__visual,
.tbp-v2-lesson {
	max-height: 31rem;
}

.tbp-v2-search-wrap {
	margin-top: clamp(-5.5rem, -7vw, -4.25rem);
}

.tbp-v2-search {
	padding: clamp(1.5rem, 3vw, 2.25rem);
}

.tbp-v2-search .tbp-v2-section-heading {
	margin-block-end: 1.75rem;
}

.tbp-v2-search .tbp-v2-section-heading h2 {
	font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.tbp-v2-search select,
.tbp-v2-search button {
	min-height: var(--tbp-release-field);
}

/* Find a Tutor: use the full hero width and keep comparison controls legible. */
.tbp-find-hero {
	padding-block: clamp(3rem, 6vw, 5.25rem);
}

.tbp-find-hero__inner {
	display: grid;
	max-width: var(--tbp-release-content);
}

.tbp-find-hero h1 {
	max-width: 18ch;
	font-size: clamp(2.5rem, 4.6vw, 4.15rem);
	text-wrap: balance;
}

.tbp-find-hero > .tbp-container > p:not(.tbp-find-kicker) {
	margin-block-end: 1.5rem;
}

.tbp-find-quick-search {
	width: min(100%, 61rem);
}

.tbp-find-filters,
.tbp-find-toolbar,
.tbp-find-notice,
.tbp-find-list > *,
.tbp-find-empty {
	border-radius: var(--tbp-release-radius);
}

.tbp-find-filter select,
.tbp-find-toolbar select {
	min-height: 2.9rem;
}

/* Group marketplace: remove unused visual void and make cards scannable. */
.tbp-group-marketplace__hero .tbp-product-hero__inner,
.tbp-group-detail .tbp-product-hero__inner {
	max-width: var(--tbp-release-content);
}

.tbp-group-grid {
	grid-template-columns: repeat(3, minmax(15rem, 1fr));
}

.tbp-group-card {
	min-height: 26rem;
}

.tbp-group-card h3 {
	line-height: 1.35;
	text-wrap: balance;
}

/* Tutor workspace: a calmer hierarchy and a real application shell. */
.tbp-workspace {
	padding-block: clamp(1.5rem, 4vw, 3rem) var(--tbp-release-safe-bottom);
}

.tbp-workspace__shell {
	gap: clamp(1.25rem, 2.5vw, 2rem);
	grid-template-columns: 15rem minmax(0, 1fr);
}

.tbp-workspace__header {
	align-items: flex-end;
	margin-block-end: 1.25rem;
}

.tbp-workspace__header h1 {
	max-width: 18ch;
	font-size: clamp(2rem, 3.4vw, 3.25rem);
	line-height: 1.08;
	text-wrap: balance;
}

.tbp-workspace-card,
.tbp-workspace__stats article {
	border-radius: var(--tbp-release-radius);
	box-shadow: 0 .75rem 2.25rem rgb(11 31 58 / 6%);
}

.tbp-whatsapp-preferences form {
	grid-template-columns: minmax(14rem, .9fr) minmax(18rem, 1.25fr) auto;
	padding-block-start: .25rem;
}

.tbp-whatsapp-preferences form label:nth-of-type(2) {
	align-self: end;
	min-height: var(--tbp-release-field);
	padding: .65rem .8rem;
	border: 1px solid #d8e1eb;
	border-radius: .75rem;
	background: #f7f9fc;
}

.tbp-tutor-choice-list label {
	min-height: 2.65rem;
	padding: .55rem .8rem;
}

/* Group creation: make the long workflow readable instead of one dense form. */
.tbp-create-group .tbp-product-shell {
	max-width: 76rem;
}

.tbp-create-group .tbp-group-form {
	padding: clamp(1.25rem, 3vw, 2.25rem);
}

.tbp-create-group .tbp-group-form fieldset {
	margin-block-end: 2rem;
	padding-block-end: 2rem;
}

.tbp-group-form legend {
	width: 100%;
	margin-block-end: 1.25rem;
	font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.tbp-group-form__grid {
	gap: 1.1rem 1.25rem;
}

.tbp-group-form label {
	align-content: start;
	line-height: 1.55;
}

.tbp-group-form input,
.tbp-group-form select {
	min-height: var(--tbp-release-field);
}

.tbp-group-form textarea {
	min-height: 8.5rem;
}

.tbp-group-form__check {
	min-height: 3.25rem;
	padding: .7rem .8rem;
	border: 1px solid var(--tbp-product-line);
	border-radius: .8rem;
	background: var(--tbp-product-soft);
}

.tbp-group-form__footer {
	position: sticky;
	z-index: 3;
	bottom: .75rem;
	padding: .9rem;
	border: 1px solid var(--tbp-product-line);
	border-radius: 1rem;
	background: color-mix(in srgb, var(--tbp-product-surface) 94%, transparent);
	box-shadow: 0 1rem 2.5rem rgb(11 31 58 / 12%);
	backdrop-filter: blur(14px);
}

/* Login and contact: reduce unnecessary height while protecting readability. */
.tbp-auth-heading {
	max-width: 14ch;
	font-size: clamp(2.25rem, 4.5vw, 4rem);
	line-height: 1.05;
	text-wrap: balance;
}

.tbp-contact-hero {
	padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(6rem, 9vw, 7.5rem);
}

.tbp-contact-hero h1 {
	font-size: clamp(2.5rem, 5vw, 4.35rem);
	text-wrap: balance;
}

/* Dark mode completion for late-loaded forms and dashboards. */
html[data-theme="dark"] .tbp-whatsapp-preferences form label:nth-of-type(2),
html[data-theme="dark"] .tbp-group-form__check {
	border-color: #355574;
	background: #0b1f3a;
	color: #fff;
}

html[data-theme="dark"] .tbp-group-form__footer {
	border-color: #355574;
	background: rgb(13 39 70 / 94%);
}

@media (max-width: 1100px) {
	.tbp-v2-hero__inner {
		grid-template-columns: 1fr;
	}

	.tbp-v2-hero__copy {
		max-width: 48rem;
	}

	.tbp-v2-hero__visual {
		width: min(100%, 42rem);
		margin-inline: auto;
	}

	.tbp-group-grid {
		grid-template-columns: repeat(2, minmax(15rem, 1fr));
	}
}

/* The compact four-item navigation remains visible on desktop and laptops.
 * It moves to the complete mobile drawer only at tablet/phone widths. */
@media (max-width: 980px) {
	.primary-navigation {
		display: none;
	}

	.site-header__inner {
		min-height: 78px;
	}

	.site-branding__logo {
		width: min(190px, 32vw);
		max-height: 54px;
	}

	.menu-toggle {
		display: block;
	}
}

@media (max-width: 980px) {
	.tbp-workspace__shell {
		grid-template-columns: 1fr;
	}

	.tbp-workspace__nav {
		position: static;
		padding: .85rem;
	}

	.tbp-workspace__nav nav {
		scrollbar-width: thin;
	}
}

@media (max-width: 760px) {
	:root {
		--tbp-release-safe-bottom: 7rem;
	}

	.tbp-container {
		width: min(calc(100% - 1.5rem), var(--tbp-release-content));
	}

	.tbp-product-hero__inner,
	.tbp-find-hero {
		padding-block: 2.75rem;
	}

	.tbp-product-hero h1,
	.tbp-find-hero h1 {
		max-width: none;
		font-size: clamp(2.05rem, 9.5vw, 3rem);
	}

	.tbp-v2-hero {
		padding-block: 3rem 7rem;
	}

	.tbp-v2-hero h1 {
		max-width: none;
		font-size: clamp(2.5rem, 11.5vw, 3.45rem);
		line-height: 1.04;
	}

	.tbp-v2-hero__visual,
	.tbp-v2-lesson {
		max-height: none;
	}

	.tbp-v2-search-wrap {
		margin-top: -4.5rem;
		padding-inline: 0;
	}

	.tbp-v2-search {
		padding: 1.25rem;
		border-radius: 1.25rem;
	}

	.tbp-find-quick-search {
		grid-template-columns: 1fr;
		padding: .6rem;
	}

	.tbp-find-search-input {
		border-inline-end: 0;
		border-block-end: 1px solid #dce4ee;
	}

	.tbp-find-popular {
		align-items: flex-start;
	}

	.tbp-group-grid {
		grid-template-columns: 1fr;
	}

	.tbp-group-card {
		min-height: 0;
	}

	.tbp-workspace__header {
		align-items: stretch;
	}

	.tbp-workspace__header h1 {
		max-width: none;
		font-size: clamp(2rem, 9vw, 2.75rem);
	}

	.tbp-whatsapp-preferences form {
		grid-template-columns: 1fr;
	}

	.tbp-group-form__grid {
		grid-template-columns: 1fr;
	}

	.tbp-group-form__footer {
		position: static;
	}

	.tbp-auth-heading {
		max-width: none;
		font-size: clamp(2.15rem, 10vw, 3rem);
	}

	.tbp-contact-hero {
		padding-block: 3rem 5.5rem;
	}

	.tbp-contact-hero__icon {
		width: 4.75rem;
		height: 4.75rem;
		margin-block-end: 1rem;
	}

	.tbp-contact-hero__icon .tbp-visual-icon {
		width: 3.2rem;
		height: 3.2rem;
	}
}

@media (max-width: 480px) {
	.tbp-v2-actions,
	.tbp-product-actions {
		display: grid;
	}

	.tbp-v2-button,
	.tbp-product-button {
		width: 100%;
	}

	.tbp-workspace__stats {
		grid-template-columns: 1fr;
	}

	.tbp-student-identity-card__profile {
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
/* Approved compact primary navigation: three direct destinations + Explore. */
.primary-menu .sub-menu {
	position: absolute;
	z-index: 30;
	inset-block-start: calc(100% + 0.35rem);
	inset-inline-start: 50%;
	display: grid;
	min-width: 230px;
	padding: 0.55rem;
	margin: 0;
	border: 1px solid var(--tbp-color-border);
	border-radius: var(--tbp-radius-lg);
	background: var(--tbp-color-surface);
	box-shadow: var(--tbp-shadow-lg);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, -0.4rem);
	transition: opacity var(--tbp-transition-fast), transform var(--tbp-transition-fast), visibility var(--tbp-transition-fast);
}

[dir="rtl"] .primary-menu .sub-menu {
	transform: translate(50%, -0.4rem);
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

[dir="rtl"] .primary-menu li:hover > .sub-menu,
[dir="rtl"] .primary-menu li:focus-within > .sub-menu {
	transform: translate(50%, 0);
}

.primary-menu .sub-menu a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0.65rem 0.8rem;
	border-radius: var(--tbp-radius-md);
	color: var(--tbp-color-heading);
	font-size: var(--tbp-font-size-sm);
	font-weight: var(--tbp-font-weight-semibold);
	text-decoration: none;
}

.primary-menu .sub-menu a:hover,
.primary-menu .sub-menu .current-menu-item > a {
	background: var(--tbp-color-surface-soft);
	color: var(--tbp-color-primary);
}

.primary-menu .tbp-menu-explore > a {
	gap: 0.45rem;
}

.primary-menu .tbp-menu-explore > a::before {
	order: 2;
	width: 0.45rem;
	height: 0.45rem;
	border-inline-end: 2px solid currentColor;
	border-block-end: 2px solid currentColor;
	content: "";
	transform: translateY(-0.12rem) rotate(45deg);
}

[dir="rtl"] .primary-menu .tbp-menu-explore > a::before {
	order: -1;
}

.primary-menu .tbp-menu-support-gaza > a::before,
.mobile-menu .tbp-menu-support-gaza > a::before {
	content: "\2665" !important;
}

.mobile-menu .sub-menu {
	display: grid;
	gap: 0.25rem;
	padding: 0.35rem;
	margin: 0.25rem 1rem 0.5rem;
	border-inline-start: 2px solid var(--tbp-color-accent);
	list-style: none;
}

.mobile-menu .sub-menu a {
	min-height: 44px;
	padding-inline: var(--tbp-space-3);
	font-size: 0.94rem;
}

.mobile-menu .tbp-menu-explore > a {
	color: var(--tbp-color-text-muted);
	font-size: 0.8rem;
	font-weight: var(--tbp-font-weight-extrabold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	pointer-events: none;
}
