/* ==========================================================================
   תן לי — Agent Register page (page-templates/agent-register.php) only.
   Loaded together with agent-app.css, which already defines the --aa-*
   tokens on the ancestor .agent-auth element (this page reuses the same
   auth-shell wrapper as screen 01, Login — tenli_agent_app_render_auth_shell_
   open()/_close()) — every rule below just inherits those custom properties,
   no new palette. Everything here is scoped under .agent-register so it can
   never leak onto any other page, and never touches main.css classes
   globally — it only re-skins the SAME shared markup (wizard__field,
   supplier-signup__*, terms-gate, .btn) that page-templates/supplier-signup.
   php also renders via the exact same PHP functions (inc/supplier-terms.php,
   inc/agent-register.php) — that page still loads main.css, so its look is
   completely unaffected. Near-identical to assets/css/agent-pilot.css (same
   shared markup, same re-skin approach) minus the search-stage rules this
   page never renders, and minus any OTP rules at all — this form has no
   email/phone verification step (see the page template's own docblock for
   why), so it never renders the .claim-otp markup either.
   ========================================================================== */

/* -------------------------------------------------------------------- */
/* Card shell — page-templates/supplier-signup.php passes this as an extra  */
/* class alongside .agent-auth__card--wide (tenli_agent_app_render_auth_    */
/* shell_open()'s $card_class param takes a space-separated list) so only   */
/* THIS page gets the wider card; agent-pilot.php keeps --wide's normal     */
/* 640px untouched. width:100% on .agent-auth__card already makes any       */
/* max-width here a ceiling, not a fixed size, so mobile needs no separate  */
/* override — it already shrinks to fit exactly like --wide does today.     */
/* -------------------------------------------------------------------- */
.supplier-signup__card { max-width: 900px; padding-top: 34px; padding-bottom: 26px; }
.agent-register .agent-auth__logo { margin-bottom: 14px; }
.agent-register .agent-auth__subtitle { margin: 6px 0 16px; color: #46526b; }

/* -------------------------------------------------------------------- */
/* Form fields — re-skins the shared .wizard__field/select/input/textarea */
/* markup (page-templates/agent-register.php, inc/signup-verification.php) */
/* with the agent-app field look instead of main.css's public-site one.   */
/* -------------------------------------------------------------------- */

.agent-register .wizard__field { margin-block-end: 12px; }
.agent-register .wizard__field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--aa-text); margin-block-end: 8px; }
.agent-register .wizard__field input[type="text"],
.agent-register .wizard__field input[type="email"],
.agent-register .wizard__field input[type="tel"],
.agent-register .wizard__field input[type="url"] {
	width: 100%;
	height: 48px;
	border: 1.5px solid var(--aa-border);
	border-radius: var(--aa-radius-sm);
	padding: 0 14px;
	font: inherit;
	font-size: 14px;
	color: var(--aa-text);
	background: var(--aa-white);
}
.agent-register .wizard__field input:focus { border-color: var(--aa-teal); }
.agent-register .wizard__field-hint { font-size: 12.5px; color: var(--aa-text-muted); margin-block-start: 6px; }

/* Step-1 field icons (2026-08 visual pass) — a small, decorative (aria-hidden,
   pointer-events:none) icon sits at the field's logical start (the right edge
   in this RTL layout) for every field on the first step; icons come from the
   shared tenli_agent_app_icon_svg() library where one already exists
   ('building'/'users'/'mail'/'phone'), plus two new small ones just for
   city/website (tenli_supplier_signup_pin_icon_svg()/_link_icon_svg(),
   inc/supplier-signup.php) since no map-pin/link icon existed in that shared
   set yet. Same positioning technique as the existing password show/hide
   icon (.agent-auth__eye/.agent-auth__password-wrap). */
.agent-register .wizard__field--icon { position: relative; }
.agent-register .wizard__field-icon {
	position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
	width: 18px; height: 18px; color: var(--aa-text-muted); pointer-events: none;
	display: flex; align-items: center; justify-content: center;
}
.agent-register .wizard__field-icon svg { width: 100%; height: 100%; }
/* Same specificity as the base input[type="..."] rule above (which sets the
   padding shorthand) is required here, or this loses the cascade and the
   icon silently overlaps the placeholder text — confirmed live via
   getComputedStyle before this fix (paddingInlineStart stayed 14px). */
.agent-register .wizard__field--icon input[type="text"],
.agent-register .wizard__field--icon input[type="email"],
.agent-register .wizard__field--icon input[type="tel"],
.agent-register .wizard__field--icon input[type="url"] { padding-inline-start: 40px; }

.agent-register .supplier-signup__specialty-list {
	display: flex; flex-wrap: wrap; gap: 8px 16px;
	border: 1.5px solid var(--aa-border); border-radius: var(--aa-radius-sm);
	padding: 12px 14px; max-height: 220px; overflow-y: auto;
}
.agent-register .supplier-signup__checkbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--aa-text); }
.agent-register .supplier-signup__checkbox input { width: auto; accent-color: var(--aa-teal-dark); }
/* Small shared icon for the ~64 "extra" specialties (2026-08) — continuing
   the icon+label direction the 6 core category cards already use, but with
   ONE consistent icon rather than 64 bespoke ones (no per-item icon asset
   exists for these, and inventing that many would be its own project). */
.agent-register .supplier-signup__checkbox-icon { width: 14px; height: 14px; color: var(--aa-teal-dark); flex-shrink: 0; display: flex; }
.agent-register .supplier-signup__checkbox-icon svg { width: 100%; height: 100%; }

/* -------------------------------------------------------------------- */
/* Terms gate (inc/supplier-terms.php) — same classes as the public page, */
/* re-skinned.                                                            */
/* -------------------------------------------------------------------- */

/* Same shared function as page-templates/supplier-signup.php and
   agent-pilot.php (inc/supplier-terms.php:tenli_render_supplier_terms_gate())
   — moved from an always-visible inline scroll box to a "פתיחת ההסכם לעיון"
   button + wide native <dialog>, staged-wizard redesign (2026-08).
   .terms-gate__scroll no longer exists in the shared markup, replaced by
   .terms-gate-modal__scroll inside the dialog. */
.agent-register .terms-gate__label { display: block; font-size: 12.5px; font-weight: 700; color: var(--aa-text); margin-block-end: 6px; }
.agent-register .terms-gate__card { text-align: center; }
.agent-register .terms-gate__summary { margin: 0 0 12px; font-size: 13px; color: var(--aa-text-muted); }
.agent-register .terms-gate__hint { font-size: 12px; color: var(--aa-text-muted); margin: 10px 0 0; }
.agent-register .terms-gate--unavailable p { font-size: 13.5px; color: var(--aa-text-muted); }

.agent-register .terms-gate-modal {
	width: min(640px, 92vw); border: none; border-radius: var(--aa-radius); padding: 0;
	max-height: calc(100vh - 80px);
	box-shadow: 0 24px 60px -20px rgba(15, 32, 57, 0.35);
}
.agent-register .terms-gate-modal::backdrop { background: rgba(5, 39, 72, 0.55); }
.agent-register .terms-gate-modal__head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 20px 24px 14px; border-bottom: 1px solid var(--aa-border);
}
.agent-register .terms-gate-modal__head h2 { font-size: 17px; color: var(--aa-navy-deep); margin: 0; }
.agent-register .terms-gate-modal__close {
	font-size: 18px; line-height: 1; padding: 6px 10px; border-radius: 8px; border: none;
	background: none; cursor: pointer; color: var(--aa-text-muted);
}
.agent-register .terms-gate-modal__close:hover { background: var(--aa-bg); }
.agent-register .terms-gate-modal__notice {
	margin: 0; padding: 10px 24px; background: var(--aa-amber-bg); color: var(--aa-amber-fg);
	font-size: 12.5px; font-weight: 700; text-align: center; border-bottom: 1px solid var(--aa-border);
}
.agent-register .terms-gate-modal__scroll {
	max-height: 50vh; overflow-y: auto; padding: 16px 24px;
	font-size: 13.5px; line-height: 1.7; color: var(--aa-text-muted);
}
.agent-register .terms-gate-modal__foot { padding: 14px 24px 20px; border-top: 1px solid var(--aa-border); text-align: left; }

/* -------------------------------------------------------------------- */
/* Buttons — reuses .btn/.btn--outline-sm class NAMES from the shared    */
/* render functions, mapped onto the agent-app button look (not          */
/* main.css's, which is never loaded on this page).                      */
/* -------------------------------------------------------------------- */

.agent-register .btn {
	display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px;
	padding: 11px 20px; border-radius: var(--aa-radius-pill); border: none; cursor: pointer;
	transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1.3), box-shadow 0.18s ease;
}
.agent-register .btn--primary { background: var(--aa-navy-deep); color: #fff; box-shadow: 0 6px 16px -6px rgba(22, 51, 90, 0.5); justify-content: center; }
/* Real bug (reported live, confirmed via getComputedStyle: near-black text
   on a near-black button — unreadable): the "already registered" screen's
   primary CTA is an <a>, not a <button>, and agent-app.css's global
   `.agent-auth a:not(.agent-app__btn){color:inherit}` (higher specificity
   than the plain .btn--primary rule above) was winning, making the link
   inherit dark body text instead of using the white set here. */
.agent-register a.btn--primary { color: #fff; }
.agent-register .btn--primary:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 12px 22px -8px rgba(22, 51, 90, 0.55); }
.agent-register .btn--primary:disabled { background: var(--aa-gray-fg); box-shadow: none; opacity: 0.6; cursor: not-allowed; }
/* Real bug (reported live, confirmed via getBoundingClientRect — the button
   rendered 812px wide inside an 812px row it shared with a real "חזרה"
   sibling, and main.css's shared .wizard__actions .btn{flex-shrink:0} meant
   it refused to shrink, pushing its own left edge outside the card). Full-
   width only makes sense when this button is ALONE in its row (substep 1's
   pattern: an empty <span></span> placeholder keeps space-between working
   without a second real button) — everywhere a real "חזרה" button shares the
   row (substep 2/3), both buttons need to size to their own content instead. */
.agent-register .wizard__actions:has(> span:empty) .btn--primary { width: 100%; }
.agent-register .btn--outline,
.agent-register .btn--outline-sm { background: transparent; color: var(--aa-navy-deep); border: 1.5px solid var(--aa-navy-deep); }
.agent-register .btn--outline-sm { padding: 8px 16px; font-size: 12.5px; }
.agent-register .btn--outline:hover,
.agent-register .btn--outline-sm:hover { background: var(--aa-navy-deep); color: #fff; }

.agent-register .wizard__actions { margin-block-start: 8px; }

/* page-templates/supplier-signup.php nests the shared .wizard__form card
   INSIDE this page's own .agent-auth__card (the white centered card the
   auth shell already draws) — without this override the two stack, giving
   a visibly nested white-box-inside-a-white-box. agent-register.php's own
   flat form happened to look fine because it never had a second card wrapper
   this obviously mismatched in width, but the bug was latent there too. */
.agent-register .wizard__form { background: none; box-shadow: none; padding: 0; border-radius: 0; }

/* -------------------------------------------------------------------- */
/* Staged wizard (page-templates/supplier-signup.php only — the "new" and */
/* "claim" 3-/2-step flow). agent-register.php's own flat form never      */
/* renders any of these classes, so none of this affects it.              */
/* -------------------------------------------------------------------- */

/* Order in the markup is now text ("שלב 1 מתוך 3") → bar → step names, per
   explicit request — margins below match that order (space AFTER the text,
   not before it like the old bar-first layout needed). */
.agent-register .ins-wizard__progress-wrap { margin-block-end: 16px; }
.agent-register .ins-wizard__progress-text {
	margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--aa-navy-deep); text-align: center;
}
.agent-register .ins-wizard__progress-track {
	height: 6px; border-radius: 999px; background: var(--aa-bg);
	border: 1px solid var(--aa-border); overflow: hidden;
}
.agent-register .ins-wizard__progress-fill { height: 100%; background: var(--aa-teal); border-radius: inherit; }
.agent-register .supplier-signup__steps-labels {
	display: flex; justify-content: space-between; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none;
	font-size: 12px; color: var(--aa-text-muted);
}
.agent-register .supplier-signup__steps-labels li { flex: 1 1 0; text-align: center; }
.agent-register .supplier-signup__steps-labels li:first-child { text-align: right; }
.agent-register .supplier-signup__steps-labels li:last-child { text-align: left; }
.agent-register .supplier-signup__steps-labels li.is-active { color: var(--aa-navy-deep); font-weight: 700; }
.agent-register .supplier-signup__steps-labels li.is-done { color: var(--aa-teal-dark); }

.agent-register .supplier-signup__substep-title { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 6px; }
/* Non-interactive: JS moves real keyboard/AT focus here on every step
   transition (screen-reader announcement + scroll target), it's never
   clicked or typed into. The site's global [tabindex]:focus-visible ring
   (main.css) still fires everywhere ELSE exactly as before — this rule only
   cancels it, and the plain :focus-visible outline that used to sit here
   too, for THIS specific heading, because together they rendered as a boxed,
   input-like frame around plain text (reported live, confirmed in
   getComputedStyle: outline + a 2-ring box-shadow stacking). */
.agent-register .supplier-signup__substep-title:focus-visible { outline: none; box-shadow: none; }
.agent-register .supplier-signup__step-badge {
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	min-width: 30px; height: 30px; padding: 0 4px; border-radius: 9px;
	background: var(--aa-navy-deep); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
}
.agent-register .supplier-signup__substep-intro { margin: 0 0 14px; color: #46526b; font-size: 13.5px; line-height: 1.6; }
.agent-register .supplier-signup__claim-summary { font-size: 15px; font-weight: 700; color: var(--aa-navy-deep); margin: 0 0 18px; text-align: center; }

/* Two columns / three rows on desktop, per explicit spec (company|contact,
   email|phone, city|website — the DOM is already in exactly that order, so
   RTL grid auto-flow alone produces the right right-column/left-column
   pairing with no reordering needed). Collapses to one column below 720px,
   same breakpoint the public (non-auth-shell) version of this class already
   uses in main.css. */
.agent-register .supplier-signup__form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 720px) {
	.agent-register .supplier-signup__form-grid { grid-template-columns: 1fr; }
}

.agent-register .supplier-signup__security-note {
	display: flex; align-items: center; gap: 8px; margin-block: 12px 0; padding: 10px 14px;
	border-radius: var(--aa-radius-sm); background: var(--aa-bg); color: #46526b; font-size: 12px;
}

.agent-register .supplier-signup__summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block-end: 18px; }
.agent-register .supplier-signup__summary-item { padding: 10px 8px; background: var(--aa-bg); border-radius: var(--aa-radius-sm); text-align: center; }
.agent-register .supplier-signup__summary-item span { display: block; margin-block-end: 4px; color: var(--aa-text-muted); font-size: 10.5px; }
.agent-register .supplier-signup__summary-item strong { font-size: 13px; color: var(--aa-navy-deep); }

/* Stacked, not the public page's 3-column grid — same narrow-card reasoning
   as the form grid above. */
.agent-register .supplier-signup__next-steps { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; text-align: right; }
.agent-register .supplier-signup__next-steps li { background: var(--aa-bg); border-radius: var(--aa-radius-sm); padding: 12px 14px; font-size: 12.5px; line-height: 1.5; }
.agent-register .supplier-signup__next-steps strong { display: block; margin-block-end: 3px; color: var(--aa-navy-deep); font-size: 12.5px; }
.agent-register .supplier-signup__next-steps span { color: var(--aa-text-muted); }

.agent-register .supplier-signup__already-registered-actions { display: flex; gap: 10px; justify-content: center; margin-block-start: 18px; flex-wrap: wrap; }

/* Same specificity fight as every other <a> in this shell (see the button-
   contrast/tab-color fixes above) — .agent-register .supplier-signup__legal-
   note a (0,2,1) is needed to beat .agent-auth a:not(.agent-app__btn)
   (0,2,1) on source order, or the link silently inherits the muted note
   color instead of standing out as a link. */
.agent-register .supplier-signup__legal-note { margin: 10px 0 0; font-size: 12px; color: var(--aa-text-muted); text-align: center; }
.agent-register .supplier-signup__legal-note a { color: var(--aa-navy-deep); text-decoration: underline; font-weight: 700; }

.agent-register #specialty-search {
	width: 100%; height: 44px; padding: 0 40px 0 14px; border: 1.5px solid var(--aa-border); border-radius: var(--aa-radius-sm);
	font: inherit; font-size: 13.5px; color: var(--aa-text);
	background: var(--aa-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316335a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.3-4.3'/%3E%3C/svg%3E") no-repeat left 12px center / 16px;
}
.agent-register #specialty-search:focus { border-color: var(--aa-teal); }

.agent-register .supplier-signup__specialty-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.agent-register .supplier-signup__specialty-toolbar strong { font-size: 13px; color: var(--aa-navy-deep); }
.agent-register .supplier-signup__specialty-count { padding: 5px 11px; border-radius: 999px; background: var(--aa-bg); color: var(--aa-navy-deep); font-size: 11.5px; font-weight: 700; }

/* Two columns, not the public page's four — narrower card. */
.agent-register .supplier-signup__specialty-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-block-end: 14px; }
.agent-register .supplier-signup__specialty-card {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; text-align: center;
	background: var(--aa-white); border: 1.5px solid var(--aa-border); border-radius: var(--aa-radius-sm);
	cursor: pointer; font-size: 12.5px; color: var(--aa-text);
}
@media (prefers-reduced-motion: no-preference) {
	.agent-register .supplier-signup__specialty-card { transition: border-color 0.15s ease, background-color 0.15s ease; }
}
.agent-register .supplier-signup__specialty-card input { position: absolute; opacity: 0; pointer-events: none; }
.agent-register .supplier-signup__specialty-card:has(input:focus-visible) { outline: 2px solid var(--aa-teal); outline-offset: 2px; }
.agent-register .supplier-signup__specialty-card:hover { border-color: var(--aa-teal); }
.agent-register .supplier-signup__specialty-card.is-selected { background: color-mix(in srgb, var(--aa-teal) 12%, var(--aa-white)); border-color: var(--aa-teal); font-weight: 700; }
.agent-register .supplier-signup__specialty-card-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.agent-register .supplier-signup__specialty-card-icon img { max-width: 100%; max-height: 100%; }

.agent-register .supplier-signup__specialty-expand-toggle { display: block; width: 100%; text-align: center; }
.agent-register .supplier-signup__specialty-expand { margin-block-start: 14px; }
.agent-register .supplier-signup__specialty-expand .supplier-signup__specialty-list { margin: 0; }
.agent-register .supplier-signup__specialty-expand .supplier-signup__checkbox.is-selected {
	background: color-mix(in srgb, var(--aa-teal) 12%, var(--aa-white)); border-radius: 8px; padding-inline: 6px; margin-inline: -6px; font-weight: 700;
}
.agent-register .supplier-signup__specialty-empty { margin: 10px 0 0; color: var(--aa-text-muted); font-size: 13px; }

@media (max-width: 480px) {
	.agent-register .supplier-signup__summary-strip { grid-template-columns: 1fr; }
	.agent-register .supplier-signup__specialty-cards { grid-template-columns: 1fr; }
}

.agent-register .wizard__done { text-align: center; padding-block: 12px; }
.agent-register .wizard__done h3 { margin-block-end: 10px; }
.agent-register .wizard__done p { font-size: 14px; line-height: 1.7; color: var(--aa-text-muted); }
.agent-register .wizard__done p + p { margin-block-start: 10px; }

.agent-register .wizard__error {
	background: var(--aa-red-bg); color: var(--aa-red-fg); border-radius: var(--aa-radius-sm);
	padding: 10px 14px; font-size: 13px; font-weight: 600; margin-block-start: 12px; text-align: center;
}

@media (max-width: 480px) {
	.agent-register .supplier-signup__specialty-list { max-height: 180px; }
}

/* Bottom "already have an account? log in" line — the <a> inherits this
   color (.agent-auth a:not(.agent-app__btn){color:inherit}, agent-app.css),
   so darkening the paragraph strengthens both the text and the link in one
   place. */
.agent-register .agent-auth__footer { color: #46526b; }
