/* Tutor 4 uses a standalone account page outside .tutor-wrap. */
body .tutor-account-page-wrapper.tutor-account-page-wrapper {
	--tutor-font-family-body: var(--ti-font-body, "Lora", Georgia, serif);
	--tutor-font-family-heading: var(--ti-font-body, "Lora", Georgia, serif);
	font-family: var(--ti-font-body, "Lora", Georgia, serif) !important;
	font-weight: 700 !important;
	font-style: italic !important;
	background: #fbddc1;
	min-height: 100vh;
}
body .tutor-account-page-wrapper.tutor-account-page-wrapper :is(
	div, section, form, h1, h2, h3, h4, h5, h6, p, label, span, a,
	button, input, textarea, select, option, small, strong, b, em, li, th, td
) {
	font-family: inherit !important;
	font-weight: 700 !important;
	font-style: italic !important;
}
body .tutor-account-page-wrapper.tutor-account-page-wrapper :is(input, textarea)::placeholder {
	font-family: inherit !important;
	font-weight: 700 !important;
	font-style: italic !important;
}
body .tutor-account-page-wrapper.tutor-account-page-wrapper :is([class^="tutor-icon-"], [class*=" tutor-icon-"], .tutor-icon) {
	font-family: "tutor" !important;
	font-weight: 400 !important;
	font-style: normal !important;
}
/* Static settings cards: Account uses a form; Security uses a section.
   Their tab panels and modal visibility remain controlled by Tutor. */
body .tutor-account-page-wrapper .tutor-account-section form > .tutor-flex > .tutor-card,
body .tutor-account-page-wrapper .tutor-profile-settings-tab-content > .tutor-tab-panel > section > .tutor-flex > .tutor-card {
	display: flex !important;
	flex-direction: column !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	max-height: none !important;
	min-width: 0 !important;
	padding: 24px !important;
	gap: 20px !important;
	background: #fdecdc !important;
	border: 1px solid rgba(0, 90, 1, .25) !important;
	border-radius: 20px !important;
}
body .tutor-account-page-wrapper .tutor-profile-settings-tab {
	background: #fdecdc !important;
	min-width: 230px;
}
body .tutor-account-page-wrapper .tutor-profile-settings-tab .tutor-tabs-tab {
	white-space: normal !important;
	letter-spacing: normal !important;
	text-align: left !important;
	height: auto !important;
}
body .tutor-account-page-wrapper .tutor-profile-settings-tab-content {
	min-width: 0 !important;
}

/* Edycja profilu: kompaktowy, brązowy przycisk zmiany zdjęcia profilowego. */
body .tutor-account-page-wrapper .tutor-account-avatar-edit,
body .tutor-account-page-wrapper .tutor-account-avatar-edit:hover,
body .tutor-account-page-wrapper .tutor-account-avatar-edit:focus {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 52px !important;
	min-width: 52px !important;
	max-width: 52px !important;
	height: 36px !important;
	min-height: 36px !important;
	max-height: 36px !important;
	padding: 6px 12px !important;
	border: 1px solid #ac590d !important;
	border-radius: 999px !important;
	background: #ac590d !important;
	color: #fff !important;
	line-height: 1 !important;
	box-shadow: none !important;
}

body .tutor-account-page-wrapper .tutor-account-avatar-edit :is(svg, i, span) {
	color: #fff !important;
}

/* Tutor 4: natywna zakładka kont społecznościowych przywrócona w PHP. */
body .tutor-account-page-wrapper .tutor-social-accounts,
body .tutor-account-page-wrapper .tutor-social-form {
	display: flex !important;
	visibility: visible !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .tutor-social-accounts {
	flex-direction: column !important;
	gap: 16px !important;
}

body .tutor-account-page-wrapper .tutor-social-form {
	box-sizing: border-box !important;
	flex-direction: column !important;
	gap: 20px !important;
	padding: 24px !important;
	background: #fff !important;
	border: 1px solid rgba(0, 90, 1, .25) !important;
	border-radius: 20px !important;
}

body .tutor-account-page-wrapper .tutor-social-field {
	display: flex !important;
	align-items: flex-start !important;
	gap: 12px !important;
	min-width: 0 !important;
	visibility: visible !important;
	opacity: 1 !important;
}

body .tutor-account-page-wrapper .tutor-social-field .tutor-input-field {
	flex: 1 1 auto !important;
	min-width: 0 !important;
}

/*
 * Preferencje Tutor 4.0.x: redesign ukrywał same karty, pozostawiając tylko
 * nagłówki sekcji. Odtwarzamy natywne karty i kontrolki bez ingerencji w ich
 * obsługę Alpine/AJAX.
 */
body .tutor-account-page-wrapper .tutor-preferences-section,
body .tutor-account-page-wrapper .tutor-preferences-section > form {
	display: block !important;
	visibility: visible !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section > form > .tutor-card {
	display: flex !important;
	flex-direction: column !important;
	visibility: visible !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	min-width: 0 !important;
	padding: 20px !important;
	background: #fff !important;
	border: 1px solid rgba(0, 90, 1, .25) !important;
	border-radius: 20px !important;
	opacity: 1 !important;
	overflow: visible !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-item {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 24px !important;
	visibility: visible !important;
	width: 100% !important;
	height: auto !important;
	min-width: 0 !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-content {
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	min-width: 0 !important;
	visibility: visible !important;
	opacity: 1 !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-action {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end !important;
	flex: 0 0 auto !important;
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section :is(
	.tutor-select,
	.tutor-form-select,
	.tutor-input-field,
	.tutor-input-wrapper,
	button,
	select
) {
	visibility: visible !important;
	max-width: 100% !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-vision-preview {
	display: flex !important;
	visibility: visible !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
}

/* Bezpieczeństwo: pole e-mail oraz oba działania zajmują pełną szerokość. */
body .tutor-account-page-wrapper .ti-katalog-security-section,
body .tutor-account-page-wrapper .ti-katalog-security-section > .tutor-flex,
body .tutor-account-page-wrapper .ti-katalog-security-card {
	display: flex !important;
	visibility: visible !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .ti-katalog-security-section,
body .tutor-account-page-wrapper .ti-katalog-security-section > .tutor-flex,
body .tutor-account-page-wrapper .ti-katalog-security-card {
	box-sizing: border-box !important;
	flex-direction: column !important;
}

body .tutor-account-page-wrapper .ti-katalog-security-card {
	position: relative !important;
	z-index: 1 !important;
	gap: 20px !important;
	padding: 24px !important;
	background: #fff !important;
	border: 1px solid rgba(0, 90, 1, .25) !important;
	border-radius: 20px !important;
	overflow: visible !important;
}

body .tutor-account-page-wrapper .ti-katalog-security-card > *,
body .tutor-account-page-wrapper .ti-katalog-security-card .tutor-input-field,
body .tutor-account-page-wrapper .ti-katalog-security-card .tutor-input-wrapper {
	visibility: visible !important;
	height: auto !important;
	max-height: none !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

body .tutor-account-page-wrapper .ti-katalog-security-card .tutor-input-field,
body .tutor-account-page-wrapper .ti-katalog-security-card .tutor-input-wrapper {
	display: block !important;
	width: 100% !important;
	min-width: 0 !important;
}

body .tutor-account-page-wrapper .ti-katalog-security-card > :is(button, .tutor-btn) {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}

body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	> .tutor-flex.tutor-items-end {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	width: 100% !important;
	min-width: 0 !important;
	gap: 12px !important;
}

body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	> .tutor-flex.tutor-items-end > .tutor-flex-1,
body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	> .tutor-flex.tutor-items-end > :not(.tutor-flex-1) {
	flex: 0 0 auto !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
}

body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	:is(.tutor-input-field, .tutor-input-wrapper, .tutor-form-control, input[type="email"]) {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	background: #fff !important;
}

body .tutor-account-page-wrapper #account_email {
	display: block !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 48px !important;
	padding: 10px 14px !important;
}

body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	:is(label, .tutor-form-label, .tutor-label) {
	display: block !important;
	width: 100% !important;
	word-break: normal !important;
	overflow-wrap: normal !important;
	white-space: normal !important;
	line-height: 1.4 !important;
}

body .tutor-account-page-wrapper .tutor-profile-settings-tab-content
	> .tutor-tab-panel > section > .tutor-flex > .tutor-card
	:is(.tutor-btn, button) {
	width: 100% !important;
	max-width: none !important;
	min-height: 48px !important;
	padding: 10px 18px !important;
	font-size: clamp(14px, 2.2vw, 18px) !important;
	line-height: 1.25 !important;
	white-space: normal !important;
	text-align: center !important;
}

body #reset-password-modal .tutor-modal-content,
body #reset-password-modal .tutor-modal-window {
	box-sizing: border-box !important;
	width: min(458px, calc(100vw - 32px)) !important;
	max-width: calc(100vw - 32px) !important;
}
body .tutor-stat-card .ti-time-explanation {
	margin: 8px 0 0;
	font-size: 13px !important;
	line-height: 1.4 !important;
	letter-spacing: normal !important;
}

/*
 * Powiadomienia Tutor są nakładką nad panelem. Po aktualizacji 4.0.7 jej
 * mobilna powierzchnia była przezroczysta, dlatego zakładki nachodziły na
 * kartę „Uzupełnij profil” z widoku znajdującego się pod spodem.
 */
body .tutor-pn-drawer,
body .tutor-pn-drawer-content {
	box-sizing: border-box !important;
	background: #fbddc1 !important;
}

body .tutor-pn-drawer-content {
	position: relative !important;
	z-index: 100 !important;
	isolation: isolate !important;
	width: 100% !important;
	min-height: calc(100dvh - 80px) !important;
	overflow-x: hidden !important;
}

body .tutor-notification-tabs-wrapper {
	box-sizing: border-box !important;
	position: relative !important;
	inset: auto !important;
	z-index: 2 !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	transform: none !important;
	background: #fdecdc !important;
	overflow: hidden !important;
}

body .tutor-notification-tabs-wrapper :is(.tutor-tabs-nav, [role="tablist"], .tab-header) {
	display: grid !important;
	grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) !important;
	align-items: stretch !important;
	gap: 6px !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 8px !important;
}

body .tutor-notification-tabs-wrapper :is([role="tab"], .tutor-tabs-tab, .tab-header-item) {
	box-sizing: border-box !important;
	min-width: 0 !important;
	max-width: 100% !important;
	height: auto !important;
	padding: 10px 8px !important;
	font-size: clamp(12px, 3.7vw, 16px) !important;
	line-height: 1.25 !important;
	letter-spacing: normal !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	text-align: center !important;
}

/* Natywny pasek akcji certyfikatu, oznaczany po wyrenderowaniu przez JS. */
body .ti-certificate-action-bar {
	box-sizing: border-box !important;
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
}

body .ti-certificate-action-bar .ti-certificate-action-button,
body .ti-certificate-action-bar .ti-certificate-action-button:hover,
body .ti-certificate-action-bar .ti-certificate-action-button:focus {
	box-sizing: border-box !important;
	width: auto !important;
	min-width: 38px !important;
	min-height: 38px !important;
	padding: 6px 11px !important;
	border-radius: 13px !important;
	background: #ac590d !important;
	border-color: #ac590d !important;
	color: #fff !important;
	font-size: 13px !important;
	line-height: 1.15 !important;
	letter-spacing: normal !important;
	white-space: normal !important;
}

body .ti-certificate-action-bar .ti-certificate-action-button * {
	color: inherit !important;
}

body .ti-certificate-action-bar .ti-certificate-action-button--green,
body .ti-certificate-action-bar .ti-certificate-action-button--green:hover,
body .ti-certificate-action-bar .ti-certificate-action-button--green:focus {
	background: #005a01 !important;
	border-color: #005a01 !important;
	color: #fff !important;
}

@media (max-width: 767px) {
	body .tutor-account-page-wrapper .ti-katalog-security-card {
		padding: 16px !important;
	}

	body .tutor-pn-drawer {
		z-index: 100000 !important;
		width: 100% !important;
		max-width: 100% !important;
		background: #fbddc1 !important;
	}

	body .tutor-pn-drawer-content {
		min-height: 100dvh !important;
		padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
	}

	body .ti-certificate-action-bar {
		justify-content: flex-start !important;
		gap: 6px !important;
		padding: 7px 70px 7px 10px !important;
	}

	body .ti-certificate-action-bar .ti-certificate-action-button {
		flex: 0 1 auto !important;
		width: auto !important;
		min-width: 38px !important;
		max-width: 150px !important;
		min-height: 38px !important;
		padding: 6px 10px !important;
		border-radius: 13px !important;
		font-size: 13px !important;
		line-height: 1.15 !important;
		letter-spacing: normal !important;
		white-space: normal !important;
	}

	body .ti-certificate-action-bar .ti-certificate-action-button--icon {
		flex: 0 0 38px !important;
		width: 38px !important;
		padding: 6px !important;
	}

	body .ti-certificate-action-bar .ti-certificate-action-button--wide {
		flex: 1 1 132px !important;
		max-width: 132px !important;
		min-width: 0 !important;
	}

	body .tutor-account-page-wrapper .tutor-account-section form > .tutor-flex > .tutor-card,
	body .tutor-account-page-wrapper .tutor-profile-settings-tab-content > .tutor-tab-panel > section > .tutor-flex > .tutor-card {
		padding: 16px !important;
	}
	body .tutor-account-page-wrapper .tutor-profile-settings-tab {
		min-width: 0;
	}

	body .tutor-account-page-wrapper .tutor-preferences-section > form > .tutor-card {
		padding: 16px !important;
	}

	body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-item {
		align-items: stretch !important;
		flex-direction: column !important;
		gap: 12px !important;
	}

	body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-action {
		justify-content: flex-end !important;
		width: 100% !important;
		padding-inline-start: 0 !important;
	}

	body .tutor-account-page-wrapper .tutor-preferences-section .tutor-preferences-setting-action :is(
		.tutor-select,
		.tutor-form-select,
		select
	) {
		width: 100% !important;
		min-width: 0 !important;
	}

	body #reset-password-modal .tutor-modal-footer {
		display: flex !important;
		flex-direction: column-reverse !important;
		align-items: stretch !important;
		gap: 10px !important;
	}

	body #reset-password-modal .tutor-modal-footer :is(.tutor-btn, button) {
		width: 100% !important;
		white-space: normal !important;
	}
}
