/* Portale Esercenti — front-end form / account styles.
   Harmonised with the theme: same tokens, radii and accent as the rest of the
   site, with safe fallbacks so the forms still look right under another theme. */

.pe-auth,
.pe-account,
.pe-form {
	--pe-accent: var(--pet-accent, #1f6feb);
	--pe-on-accent: var(--pet-on-accent, #fff);
	--pe-accent-text: var(--pet-accent-text, #1f5fbf);
	--pe-accent-dark: var(--pet-accent-dark, #1a5fcc);
	--pe-tint: var(--pet-accent-tint, #eef4fe);
	--pe-tint-2: var(--pet-accent-tint-2, #d6e4fb);
	--pe-border: var(--pet-border, #dde3ec);
	--pe-panel: var(--pet-panel, #fff);
	--pe-surface: var(--pet-surface, #eef2f8);
	--pe-surface-2: var(--pet-surface-2, #e2e8f1);
	--pe-ink: var(--pet-ink, #313846);
	--pe-ink-soft: var(--pet-ink-soft, #616774);
	--pe-radius: var(--pet-radius, 6px);
	--pe-card-radius: 16px;
	--pe-shadow: 0 10px 40px rgba(20, 22, 28, .09);

	font-family: var(--pet-font, "Helvetica Neue", Helvetica, Arial, sans-serif);
	color: var(--pe-ink);
}

/* =====================================================================
   Auth card (login / register / password)
   ===================================================================== */

.pe-auth {
	max-width: 460px;
	margin: 8px auto 40px;
}
.pe-auth--register,
.pe-auth--wide { max-width: 560px; }

.pe-auth__card {
	background: var(--pe-panel);
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-card-radius);
	box-shadow: var(--pe-shadow);
	overflow: hidden;
}

.pe-auth__head {
	padding: 30px 32px 22px;
	text-align: center;
	background:
		linear-gradient(180deg, var(--pe-tint), transparent);
	border-bottom: 1px solid var(--pe-border);
}
.pe-auth__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 12px;
	border-radius: 12px;
	background: var(--pe-accent);
	color: var(--pe-on-accent);
}
.pe-auth__title {
	margin: 0;
	font-size: 1.4rem;
	letter-spacing: -.01em;
}
.pe-auth__sub {
	margin: 6px 0 0;
	font-size: .92rem;
	color: var(--pe-ink-soft);
	line-height: 1.5;
}
.pe-auth__lead {
	margin: 0 0 18px;
	font-size: .92rem;
	line-height: 1.55;
	color: var(--pe-ink-soft);
}
.pe-auth__body { padding: 26px 32px 28px; }
.pe-auth__foot {
	padding: 16px 32px 22px;
	border-top: 1px solid var(--pe-border);
	background: var(--pe-surface);
	text-align: center;
	font-size: .88rem;
	color: var(--pe-ink-soft);
	line-height: 1.6;
}
.pe-auth__foot a { color: var(--pe-accent-text); font-weight: 600; }
.pe-auth__foot-sep { margin: 0 8px; opacity: .5; }

/* TradePress line below the card — always the same on every portal, so the
   shared-access layer is recognisable. Vendor colour is fixed, not the client
   accent. */
.pe-auth__vendor {
	margin: 14px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	font-size: .72rem;
	color: var(--pe-ink-soft);
}
.pe-auth__vendor a {
	padding: 3px 9px;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .02em;
	background: #ff8a65;
	color: #fff;
	text-decoration: none;
}
.pe-auth__vendor a:hover { background: #ff7a50; }
.pe-account--dashboard .pe-auth__vendor { margin-top: 26px; }

/* "You can reuse your TradePress account" hint on login / registration.
   Colori TradePress fissi (non l'accent del cliente): lo strato di accesso
   condiviso deve avere continuità su ogni portale. */
.pe-auth__hint {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 20px;
	padding: 14px 16px;
	background: #ff8a65;
	border: 1px solid #ff8a65;
	border-radius: var(--pe-radius);
	box-shadow: 0 4px 14px rgba(255, 138, 101, .35);
	font-size: .85rem;
	line-height: 1.3;
	color: rgba(255, 255, 255, .92);
}
.pe-auth__hint-ico {
	flex: none;
	display: block;
	margin-top: 1px;
	padding: 3px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	color: #fff;
}
.pe-auth__hint strong { color: #fff; font-weight: 700; }
.pe-auth__hint a { color: #fff; font-weight: 700; text-decoration: underline; }

/* =====================================================================
   Dashboard
   ===================================================================== */

.pe-account--dashboard {
	max-width: 780px;
	margin: 8px auto 44px;
}

.pe-account__header {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 22px 24px;
	margin: 0 0 20px;
	background: var(--pe-panel);
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-card-radius);
	box-shadow: var(--pe-shadow);
}
.pe-account__ident { flex: 1 1 auto; min-width: 0; }
.pe-account__name {
	margin: 0;
	font-size: 1.35rem;
	letter-spacing: -.01em;
	line-height: 1.2;
}
.pe-account__org {
	margin: 3px 0 0;
	color: var(--pe-ink-soft);
	font-size: .92rem;
}
.pe-account__header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pe-account__logout { flex: none; }

/* Section cards */
.pe-card {
	background: var(--pe-panel);
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-card-radius);
	padding: 22px 24px;
	margin: 0 0 16px;
}
.pe-card__title {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--pe-ink);
}

.pe-account__actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 6px 2px 0;
	margin-top: 4px;
}
.pe-account__actions--stacked {
	justify-content: flex-start;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 12px;
}
.pe-account__actions--stacked form { margin: 0; }

.pe-card--privacy { margin-top: 48px; }
.pe-card--privacy .pe-field__hint { margin: 4px 0 0; }

/* Standalone "Richiedi assistenza" page: full-width single-select options
   (radio input visually hidden, its label styled as the selectable row). */
.pe-support__reasons {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 10px 0 20px;
}
.pe-reason { position: relative; }
.pe-reason input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.pe-reason label {
	display: block;
	width: 100%;
	padding: 13px 16px;
	background: var(--pe-surface);
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-radius);
	font-weight: 600;
	font-size: .92rem;
	color: var(--pe-ink);
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.pe-reason input:checked + label {
	border-color: var(--pe-accent);
	background: var(--pe-tint);
	color: var(--pe-accent-dark);
}
.pe-reason input:focus-visible + label {
	outline: 2px solid var(--pe-accent);
	outline-offset: 2px;
}
.pe-field--support-msg { margin-top: 4px; }

/* =====================================================================
   Avatar
   ===================================================================== */

.pe-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	border-radius: 50%;
	overflow: hidden;
	background: var(--pe-surface-2);
	box-shadow: inset 0 0 0 1px rgba(20, 22, 28, .06);
}
.pe-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-avatar--placeholder {
	background: linear-gradient(140deg, var(--pe-accent), var(--pe-accent-dark));
	color: var(--pe-on-accent);
	font-weight: 700;
	line-height: 1;
}
.pe-avatar--placeholder > span { letter-spacing: .02em; }

.pe-avatar-field {
	display: flex;
	align-items: flex-start;
	gap: 20px;
}
.pe-avatar-field__preview { box-shadow: inset 0 0 0 1px rgba(20, 22, 28, .06), 0 4px 14px rgba(20, 22, 28, .1); }
.pe-avatar-field__controls { flex: 1 1 auto; min-width: 0; }

.pe-avatar-upload {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	cursor: pointer;
}
.pe-avatar-upload input[type="file"] {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}
.pe-avatar-upload__btn {
	display: inline-block;
	padding: 9px 16px;
	border: 1px solid var(--pe-accent);
	border-radius: var(--pe-radius);
	background: var(--pe-tint);
	color: var(--pe-accent-text);
	font-weight: 700;
	font-size: .88rem;
	transition: background .15s ease;
}
.pe-avatar-upload:hover .pe-avatar-upload__btn { background: var(--pe-tint-2); }
.pe-avatar-upload input:focus-visible + .pe-avatar-upload__btn {
	outline: 0;
	box-shadow: 0 0 0 3px var(--pe-tint-2);
}
.pe-avatar-upload__name {
	font-size: .85rem;
	color: var(--pe-ink-soft);
	word-break: break-all;
}
.pe-avatar-field__remove {
	display: flex !important;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	font-size: .88rem;
}
.pe-avatar-field__remove input { width: 17px; height: 17px; accent-color: var(--pe-accent); }

/* =====================================================================
   Status pill
   ===================================================================== */

.pe-pill {
	display: inline-block;
	margin-top: 8px;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .01em;
}
.pe-pill--pending  { background: #fdf6e6; color: #8a6d1a; box-shadow: inset 0 0 0 1px #f0dfb3; }
.pe-pill--approved { background: #eaf7ee; color: #1a7a3d; box-shadow: inset 0 0 0 1px #bfe4cb; }
.pe-pill--rejected { background: #fdecec; color: #b5292b; box-shadow: inset 0 0 0 1px #f2c2c2; }

/* =====================================================================
   Fields
   ===================================================================== */

.pe-field { margin: 0 0 18px; }
.pe-field:last-child { margin-bottom: 0; }
.pe-field > label,
.pe-field__label {
	display: block;
	font-weight: 700;
	font-size: .9rem;
	color: var(--pe-ink);
	margin-bottom: 7px;
}
.pe-req { color: #d63638; font-weight: 700; }

.pe-field input[type="text"],
.pe-field input[type="email"],
.pe-field input[type="tel"],
.pe-field input[type="password"],
.pe-field input[type="url"],
.pe-field input[type="number"],
.pe-select-wrap select {
	width: 100%;
	height: 48px;
	padding: 0 15px;
	border: 1px solid var(--pe-border);
	border-radius: 10px;
	font: inherit;
	font-size: 1rem;
	color: var(--pe-ink);
	background: var(--pe-panel);
	transition: border-color .15s ease, box-shadow .15s ease;
	appearance: none;
	-webkit-appearance: none;
}
.pe-field input:focus,
.pe-select-wrap select:focus {
	outline: 0;
	border-color: var(--pe-accent);
	box-shadow: 0 0 0 3px var(--pe-tint-2);
}
.pe-field input::placeholder { color: var(--pe-ink-soft); }

/* Textarea — Safari has no useful default (small, monospace), so it needs
   the same explicit treatment as the text inputs above. */
.pe-field textarea {
	display: block;
	width: 100%;
	min-height: 110px;
	padding: 13px 15px;
	border: 1px solid var(--pe-border);
	border-radius: 10px;
	font: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pe-ink);
	background: var(--pe-panel);
	resize: vertical;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.pe-field textarea:focus {
	outline: 0;
	border-color: var(--pe-accent);
	box-shadow: 0 0 0 3px var(--pe-tint-2);
}
.pe-field textarea::placeholder { color: var(--pe-ink-soft); }

/* Side-by-side row */
.pe-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin: 0 0 18px;
}
.pe-field-row .pe-field { margin: 0; }

/* Password field + show/hide toggle */
.pe-input-wrap { position: relative; display: block; }
.pe-input-wrap input { padding-right: 46px; }
.pe-pass-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 46px;
	height: 48px;
	border: 0;
	background-color: var(--pe-ink-soft);
	cursor: pointer;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}
.pe-pass-toggle:hover { background-color: var(--pe-ink); }
.pe-pass-toggle.is-visible {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.39-1.61'/%3E%3Cline x1='2' x2='22' y1='2' y2='22'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.39-1.61'/%3E%3Cline x1='2' x2='22' y1='2' y2='22'/%3E%3C/svg%3E");
}

/* Select chevron */
.pe-select-wrap { position: relative; display: block; }
.pe-select-wrap select {
	padding-right: 42px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23737a86' stroke-width='1.6' stroke-linecap='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px 8px;
}

/* Checkbox rows */
.pe-field--check > label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 400;
	margin-bottom: 0;
}
.pe-field--check input { margin: 2px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--pe-accent); }
.pe-field--check .pe-req { margin-left: 2px; }

.pe-field__hint {
	display: block;
	font-size: .85rem;
	line-height: 1.5;
	color: var(--pe-ink-soft);
	margin-top: 8px;
}
.pe-field__hint a { color: var(--pe-accent-text); }
.pe-field__hint--notice {
	margin-top: 18px;
	padding: 10px 14px;
	border-radius: var(--pe-radius, 10px);
	background: var(--pe-surface-2, #f3f4f6);
}
.pe-field__static {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--pe-surface);
	font-weight: 700;
	font-size: .95rem;
}

/* =====================================================================
   Buttons
   ===================================================================== */

.pe-field--submit {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 20px;
	margin-bottom: 0;
}
.pe-btn {
	display: inline-block;
	background: var(--pe-accent);
	color: var(--pe-on-accent);
	border: 1px solid var(--pe-accent);
	padding: 13px 26px;
	border-radius: var(--pe-radius);
	font: inherit;
	font-weight: 700;
	font-size: .95rem;
	letter-spacing: .01em;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, border-color .15s ease;
}
.pe-btn:hover { background: var(--pe-accent-dark); border-color: var(--pe-accent-dark); }
.pe-btn--block { display: block; width: 100%; text-align: center; }
.pe-auth__help-btn { margin-top: 12px; }
.pe-btn--sm { padding: 8px 15px; font-size: .85rem; }
.pe-btn--xs { padding: 5px 11px; font-size: .78rem; }
.pe-btn--ghost {
	background: transparent;
	color: var(--pe-accent-text);
	border-color: var(--pe-accent);
}
.pe-btn--ghost:hover { background: var(--pe-tint); color: var(--pe-accent-dark); border-color: var(--pe-accent-dark); }
.pe-btn--ghost.pe-btn--danger { color: #b3261e; border-color: #e6b4b0; background: transparent; }
.pe-btn--ghost.pe-btn--danger:hover { background: #b3261e; border-color: #b3261e; color: #fff; }
.pe-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: var(--pe-ink-soft);
	font: inherit;
	font-size: .85rem;
	text-decoration: underline;
	cursor: pointer;
}
.pe-link-btn:hover { color: var(--pe-accent-text); }

/* =====================================================================
   "Richiedi assistenza": before-you-ask wizard
   ===================================================================== */

.pe-support-wizard {
	margin-bottom: 24px;
	padding: 18px 20px;
	border: 1px solid var(--pe-border);
	border-radius: var(--pe-radius);
	background: var(--pe-surface, #f7f9fc);
}
.pe-support-wizard__title { margin: 0 0 14px; font-weight: 700; color: var(--pe-ink); }
.pe-support-wizard__q { margin: 0 0 12px; color: var(--pe-ink); }
.pe-support-wizard__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.pe-support-wizard__step .pe-notice { margin-bottom: 12px; }
.pe-support-wizard__step .pe-auth__hint { margin-bottom: 12px; }
.pe-support-wizard__skip { margin: 14px 0 0; }

/* =====================================================================
   Messages — same visual language as the theme's .pet-notice
   ===================================================================== */

.pe-notice,
.pe-form__errors {
	padding: 14px 16px;
	margin: 0 0 18px;
	background: var(--pe-surface);
	border: 1px solid var(--pe-border);
	border-left: 3px solid var(--pe-accent);
	border-radius: var(--pe-radius);
	font-size: .92rem;
	line-height: 1.55;
	color: var(--pe-ink);
}
.pe-notice a,
.pe-form__errors a { color: var(--pe-accent-text); font-weight: 600; }

.pe-form__errors {
	border-left-color: #d63638;
	background: #fdecec;
	border-color: #f2c2c2;
}
.pe-form__errors ul { margin: 0; padding-left: 18px; }
.pe-form__errors li + li { margin-top: 4px; }
.pe-form__errors p { margin: 0; }

.pe-notice--warning,
.pe-notice--pending { border-left-color: #dba617; background: #fdf6e6; border-color: #f0dfb3; }
.pe-notice--success,
.pe-notice--approved { border-left-color: #1a9e4b; background: #eaf7ee; border-color: #bfe4cb; }
.pe-notice--error,
.pe-notice--rejected { border-left-color: #d63638; background: #fdecec; border-color: #f2c2c2; }
.pe-notice--action { border-left-color: var(--pe-accent); background: var(--pe-accent-tint, var(--pe-surface)); }
.pe-notice--action strong { display: block; margin-bottom: 3px; color: var(--pe-ink); }
.pe-notice--action p { margin: 0; }

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 560px) {
	.pe-auth__head { padding: 26px 22px 20px; }
	.pe-auth__body { padding: 22px; }
	.pe-auth__foot { padding: 14px 22px 18px; }

	.pe-account__header { flex-wrap: wrap; gap: 14px; padding: 18px; }
	.pe-account__header-actions { order: 3; width: 100%; }
	.pe-account__header-actions a { flex: 1 1 auto; text-align: center; }
	.pe-card { padding: 18px; }

	.pe-field-row { grid-template-columns: 1fr; gap: 0; }
	.pe-field-row .pe-field { margin: 0 0 18px; }

	.pe-avatar-field { flex-direction: column; align-items: center; text-align: center; }
	.pe-avatar-upload { justify-content: center; }
	.pe-avatar-field__remove { justify-content: center; }

	.pe-account__actions { justify-content: stretch; }
	.pe-account__actions .pe-btn { flex: 1; text-align: center; }
}
