/**
 * Partner Form
 *
 * Design tokens are in the first rule: change colours, radius and sizes there.
 * The font family is inherited from the site.
 *
 * About the selectors: every rule starts with `.ptf:not(#ptf)`. The `:not()`
 * part matches every form and exists only to outrank the theme's and
 * Elementor's global input, select, button, link and heading styles.
 */

.ptf {
	--ptf-accent: #e1306c;       /* links, check icon, "Change" */
	--ptf-ink: #111111;          /* text, buttons */
	--ptf-muted: #6b6b6b;        /* subtitle, "Org. no.", legal line */
	--ptf-placeholder: #8c8c8c;
	--ptf-surface: #f5f5f5;      /* company card, dial-code segment */
	--ptf-line: #e3e3e3;         /* input borders */
	--ptf-line-strong: #c4c4c4;  /* input border on hover */
	--ptf-danger: #c62828;
	--ptf-danger-surface: #fdecec;
	--ptf-radius: 6px;
	--ptf-control-height: 46px;
	--ptf-gap-x: 24px;
	--ptf-gap-y: 18px;
	--ptf-max-width: 588px;
}

/* --- Frame ------------------------------------------------------------- */

.ptf:not(#ptf) {
	max-width: var(--ptf-max-width);
	margin-inline: auto;
	color: var(--ptf-ink);
	font-size: 16px;
	line-height: 1.4;
	text-align: left;
}

.ptf:not(#ptf),
.ptf:not(#ptf) *,
.ptf:not(#ptf) *::before,
.ptf:not(#ptf) *::after {
	box-sizing: border-box;
}

/* The form itself is transparent, with no border or shadow, so the block it
   sits in (an Elementor container) supplies the background. [partner_form
   card="yes"] turns the white card on. */
.ptf:not(#ptf) {
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.ptf:not(#ptf).ptf--card {
	padding: 28px;
	border-radius: 16px;
	background: #fff;
}

.ptf:not(#ptf) [hidden] {
	display: none !important;
}

.ptf:not(#ptf) .ptf-form {
	margin: 0;
}

/* --- Heading ----------------------------------------------------------- */

.ptf:not(#ptf) .ptf-head {
	margin: 0 0 30px;
}

.ptf:not(#ptf) .ptf-title {
	margin: 0;
	padding: 0;
	color: var(--ptf-ink);
	font-size: 32px;
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-transform: none;
}

.ptf:not(#ptf) .ptf-subtitle {
	margin: 4px 0 0;
	color: var(--ptf-muted);
	font-size: 16px;
	line-height: 1.4;
}

/* --- Sections and grid ------------------------------------------------- */

.ptf:not(#ptf) .ptf-section {
	margin: 0 0 30px;
}

.ptf:not(#ptf) .ptf-legend {
	margin: 0 0 14px;
	color: var(--ptf-ink);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

/* Two columns while each can be at least 200px wide, otherwise one. The
   switch follows the width of the form itself, not of the screen.
   Deliberately not a container query: `container-type` on the form makes
   Elementor's flex containers measure it as if it were a few pixels wide,
   which leaves a tall empty gap under the form on phones. */
.ptf:not(#ptf) .ptf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, max(200px, calc(50% - var(--ptf-gap-x) / 2))), 1fr));
	gap: var(--ptf-gap-y) var(--ptf-gap-x);
}

.ptf:not(#ptf) .ptf-field {
	min-width: 0;
}

.ptf:not(#ptf) .ptf-field--full {
	grid-column: 1 / -1;
}

@media (max-width: 480px) {
	.ptf:not(#ptf).ptf--card {
		padding: 22px 18px;
	}
	.ptf:not(#ptf) .ptf-title {
		font-size: 28px;
	}
}

/* --- Labels and controls ----------------------------------------------- */

.ptf:not(#ptf) .ptf-label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	color: var(--ptf-ink);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
}

.ptf:not(#ptf) .ptf-input {
	display: block;
	width: 100%;
	max-width: none;
	height: var(--ptf-control-height);
	min-height: 0;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--ptf-line);
	border-radius: var(--ptf-radius);
	outline: 0;
	background-color: #fff;
	box-shadow: none;
	color: var(--ptf-ink);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ptf:not(#ptf) .ptf-input::placeholder {
	color: var(--ptf-placeholder);
	opacity: 1;
}

.ptf:not(#ptf) .ptf-input:hover {
	border-color: var(--ptf-line-strong);
}

.ptf:not(#ptf) .ptf-input:focus {
	border-color: var(--ptf-ink);
	box-shadow: 0 0 0 1px var(--ptf-ink);
}

.ptf:not(#ptf) .ptf-select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 14px 14px;
	cursor: pointer;
}

/* "Select" reads as a placeholder until an option is chosen. */
.ptf:not(#ptf) .ptf-select:has(option[value=""]:checked) {
	color: var(--ptf-placeholder);
}

.ptf:not(#ptf) .ptf-select option {
	color: var(--ptf-ink);
}

/* --- Field errors ------------------------------------------------------ */

.ptf:not(#ptf) .ptf-error {
	margin: 6px 0 0;
	color: var(--ptf-danger);
	font-size: 14px;
	line-height: 1.4;
}

.ptf:not(#ptf) .ptf-error:empty {
	display: none;
}

.ptf:not(#ptf) .ptf-error.is-info {
	color: var(--ptf-muted);
}

.ptf:not(#ptf) .is-invalid .ptf-input {
	border-color: var(--ptf-danger);
}

.ptf:not(#ptf) .is-invalid .ptf-input:focus {
	box-shadow: 0 0 0 1px var(--ptf-danger);
}

.ptf:not(#ptf) .ptf-form-error {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: var(--ptf-radius);
	background: var(--ptf-danger-surface);
	color: var(--ptf-danger);
	font-size: 14px;
	line-height: 1.4;
}

/* --- Company lookup ---------------------------------------------------- */

.ptf:not(#ptf) .ptf-org__search {
	display: flex;
	align-items: stretch;
	gap: 14px;
}

.ptf:not(#ptf) .ptf-org__search .ptf-input {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
}

.ptf:not(#ptf) .ptf-org__find {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	height: var(--ptf-control-height);
	min-height: 0;
	margin: 0;
	padding: 0 22px;
	border: 1.5px solid var(--ptf-ink);
	border-radius: var(--ptf-radius);
	background: #fff;
	box-shadow: none;
	color: var(--ptf-ink);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ptf:not(#ptf) .ptf-org__find:focus {
	border-color: var(--ptf-ink);
	background: #fff;
	color: var(--ptf-ink);
}

.ptf:not(#ptf) .ptf-org__find:hover {
	border-color: var(--ptf-ink);
	background: var(--ptf-ink);
	color: #fff;
}

.ptf:not(#ptf) .ptf-org__find[disabled] {
	border-color: var(--ptf-ink);
	background: #fff;
	color: var(--ptf-ink);
	opacity: 0.6;
	cursor: progress;
}

.ptf:not(#ptf) .ptf-org__find-icon {
	flex: none;
}

/* While the register is being queried the magnifier becomes a spinner. */
.ptf:not(#ptf) .ptf-org__find.is-loading .ptf-org__find-icon {
	display: none;
}

.ptf:not(#ptf) .ptf-org__find.is-loading::before,
.ptf:not(#ptf) .ptf-submit.is-loading::before {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ptf-spin 0.7s linear infinite;
}

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

.ptf:not(#ptf) .ptf-org__card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 11px 16px 12px;
	border: 1px solid var(--ptf-line);
	border-radius: var(--ptf-radius);
	background: var(--ptf-surface);
}

.ptf:not(#ptf) .ptf-org__info {
	min-width: 0;
}

.ptf:not(#ptf) .ptf-org__name {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ptf-ink);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.ptf:not(#ptf) .ptf-org__check {
	flex: none;
	color: var(--ptf-accent);
}

.ptf:not(#ptf) .ptf-org__no {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 8px;
	margin-top: 4px;
	color: var(--ptf-muted);
	font-size: 16px;
	line-height: 1.4;
}

.ptf:not(#ptf) .ptf-org__flag {
	display: inline-flex;
	flex: none;
	line-height: 0;
}

.ptf:not(#ptf) .ptf-org__flag:empty,
.ptf:not(#ptf) .ptf-org__country:empty,
.ptf:not(#ptf) .ptf-org__country:empty + .ptf-org__sep {
	display: none;
}

.ptf:not(#ptf) .ptf-org__flag svg {
	display: block;
	width: 22px;
	height: 16px;
}

.ptf:not(#ptf) .ptf-org__change {
	flex: none;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 4px 0;
	border: 0;
	border-radius: 2px;
	background: none;
	box-shadow: none;
	color: var(--ptf-accent);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.ptf:not(#ptf) .ptf-org__change:hover,
.ptf:not(#ptf) .ptf-org__change:focus {
	background: none;
	color: var(--ptf-accent);
	text-decoration: underline;
}

/* --- Submit and legal line --------------------------------------------- */

.ptf:not(#ptf) .ptf-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: var(--ptf-radius);
	background: var(--ptf-ink);
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ptf:not(#ptf) .ptf-submit:hover,
.ptf:not(#ptf) .ptf-submit:focus {
	background: #2e2e2e;
	color: #fff;
}

.ptf:not(#ptf) .ptf-submit[disabled] {
	background: var(--ptf-ink);
	opacity: 0.75;
	cursor: progress;
}

.ptf:not(#ptf) .ptf-submit:focus-visible,
.ptf:not(#ptf) .ptf-org__find:focus-visible,
.ptf:not(#ptf) .ptf-org__change:focus-visible,
.ptf:not(#ptf) .ptf-legal a:focus-visible {
	outline: 2px solid var(--ptf-accent);
	outline-offset: 2px;
}

.ptf:not(#ptf) .ptf-legal {
	margin: 14px 0 0;
	color: var(--ptf-muted);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
}

.ptf:not(#ptf) .ptf-legal a {
	color: var(--ptf-accent);
	font-weight: 600;
	text-decoration: none;
}

.ptf:not(#ptf) .ptf-legal a:hover {
	color: var(--ptf-accent);
	text-decoration: underline;
}

/* --- Confirmation ------------------------------------------------------ */

.ptf:not(#ptf) .ptf-success {
	padding: 12px 0;
	outline: 0;
}

.ptf:not(#ptf) .ptf-success__icon {
	display: block;
	margin: 0 0 14px;
	color: var(--ptf-accent);
}

/* --- Spam trap: off-screen, not display:none, so bots still see it ----- */

.ptf:not(#ptf) .ptf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.ptf:not(#ptf) .ptf-org__find.is-loading::before,
	.ptf:not(#ptf) .ptf-submit.is-loading::before {
		animation-duration: 2s;
	}
	.ptf:not(#ptf) .ptf-input,
	.ptf:not(#ptf) .ptf-org__find,
	.ptf:not(#ptf) .ptf-submit {
		transition: none;
	}
}

/* --- Phone (intl-tel-input) ---------------------------------------------
 * On phones the country list opens as a full-screen layer attached to
 * <body>, outside .ptf, so these rules cannot rely on the .ptf prefix and
 * carry their own fallback colours.
 * ---------------------------------------------------------------------- */

.iti {
	--iti-border-color: var(--ptf-line, #e3e3e3);
	--iti-icon-color: var(--ptf-ink, #111111);
	--iti-spacer-horizontal: 14px;
	--iti-arrow-padding: 10px;
	--iti-arrow-size: 7px;
}

.ptf:not(#ptf) .iti {
	display: block;
	width: 100%;
}

/* The library sets the left padding inline, right up against the dial
   code. text-indent adds the breathing room the design has. */
.ptf:not(#ptf) .iti .ptf-input {
	text-indent: 8px;
}

/* Grey "+47 v" segment on the left of the input. Written out in full so
   theme button styles cannot leak in: a theme reset that sets
   `button { display: inline-block }` otherwise drops the code below the arrow. */
.iti .iti__selected-country {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: row-reverse; /* dial code first, arrow after it */
	align-items: center;
	width: auto;
	height: 100%;
	white-space: nowrap;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-right: 1px solid var(--ptf-line, #e3e3e3);
	border-radius: calc(var(--ptf-radius, 6px) - 1px) 0 0 calc(var(--ptf-radius, 6px) - 1px);
	background: var(--ptf-surface, #f5f5f5);
	box-shadow: none;
	color: var(--ptf-ink, #111111);
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.iti .iti__selected-country:hover,
.iti .iti__selected-country:focus {
	background: var(--ptf-line, #e3e3e3);
	color: var(--ptf-ink, #111111);
}

.iti .iti__selected-country:focus-visible {
	outline: 2px solid var(--ptf-accent, #e1306c);
	outline-offset: -2px;
}

/* No flag or globe in the closed state, as in the design. */
.iti .iti__selected-country .iti__flag {
	display: none;
}

.iti .iti__selected-country-primary {
	padding: 0 var(--iti-spacer-horizontal) 0 0;
}

.iti .iti__selected-dial-code {
	margin: 0 0 0 var(--iti-spacer-horizontal);
}

.iti .iti__country-selector {
	border-radius: var(--ptf-radius, 6px);
	color: var(--ptf-ink, #111111);
	font-size: 15px;
	line-height: 1.4;
}

/* Keep the list above neighbouring fields. */
.iti--inline-country-selector .iti__country-selector {
	z-index: 20;
}

/* Doubled class: has to outrank Elementor's site-wide input styling. */
.iti.iti .iti__country-selector .iti__search-input {
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 8px calc(var(--iti-spacer-horizontal) * 2 + var(--iti-clear-icon-size)) 8px calc(var(--iti-spacer-horizontal) * 2 + var(--iti-globe-icon-size));
	border: 0;
	border-radius: 3px;
	background: #fff;
	box-shadow: none;
	color: var(--ptf-ink, #111111);
	font: inherit;
}

.iti .iti__search-clear,
.iti .iti__search-clear:hover,
.iti .iti__search-clear:focus {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-height: 0;
	padding: 5px;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
}

/* The library hides parts (such as the clear button of an empty search)
   with this class; keep it stronger than the display rules above. */
.iti .iti__hide {
	display: none;
}
