/* Public, non-marketing pages on templates/public_base.html: login, registration
   funnel, password reset, guest (PIN) buyer pages. Tabler stays for the page
   components; this file restyles them with the public site tokens
   (site-fonts.css) so the funnel feels like one site. */

.public-shell {
  --tblr-primary: #2F4A2A;
  --tblr-primary-rgb: 47, 74, 42;
  --tblr-primary-text: #2F4A2A;
  --tblr-link-color: #2F4A2A;
  --tblr-link-color-rgb: 47, 74, 42;
  --tblr-link-hover-color: #17221A;
  --tblr-font-sans-serif: var(--site-sans);
  --tblr-body-font-family: var(--site-sans);
  --tblr-body-color: #17221A;
  --tblr-body-bg: #F3F0E7;
  --tblr-border-color: #DAD6CA;
  --tblr-border-radius: 14px;
  --public-ink: #17221A;
  --public-muted: #4C564B;
  --public-line: #DAD6CA;
  --public-primary: #2F4A2A;
  --public-primary-dark: #17221A;
  --public-soft: #E6E9DB;
  --public-shadow: 0 20px 50px rgba(23, 34, 26, .08);
}

html { scroll-behavior: smooth; }

body.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--public-ink);
  background: var(--site-cream);
  font-family: var(--site-sans);
  font-size: 16px;
}

.public-shell a:focus-visible,
.public-shell button:focus-visible,
.public-shell input:focus-visible,
.public-shell select:focus-visible,
.public-shell textarea:focus-visible,
.public-shell summary:focus-visible {
  outline: 3px solid var(--site-sage);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Header ---- */
.public-header { position: sticky; top: 0; z-index: 20; background: var(--site-forest); color: var(--site-cream); }
.public-header-inner {
  width: min(1296px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.public-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--site-cream); text-decoration: none; }
.public-brand:hover { color: var(--site-cream); text-decoration: none; }
.public-brand__tile { width: 36px; height: 36px; border-radius: 10px; background: var(--site-cream); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.public-brand__tile img { width: 22px; height: 25px; object-fit: contain; }
.public-brand__name { font-family: var(--site-display); font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.public-nav { display: flex; align-items: center; gap: 18px; }
.public-nav form { margin: 0; }
.public-nav-link { color: var(--site-cream); font-size: 15px; text-decoration: none; }
.public-nav-link:hover { color: var(--site-sage-light); text-decoration: none; }
/* Guest "Adataim" link: a dot while required buyer data is missing. */
.public-nav-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #F2B84B; vertical-align: super; }
.public-nav-dot--toggle { position: absolute; top: 8px; right: 8px; margin: 0; }
.public-nav-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--site-cream); border-radius: 999px; background: var(--site-cream); color: var(--site-forest);
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.public-nav-button:hover { background: #fff; color: var(--site-forest); text-decoration: none; }
.public-nav-button--ghost { background: transparent; color: var(--site-cream); border-color: #56685A; }
.public-nav-button--ghost:hover { background: transparent; color: var(--site-cream); border-color: var(--site-sage); }
.public-language-switch {
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--site-dark-border); border-radius: 999px;
  background: transparent; color: var(--site-cream); font-size: 14px; font-weight: 600;
}
.public-language-switch:hover { border-color: var(--site-sage); }
.public-menu-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--site-dark-border);
  position: relative; background: transparent; color: var(--site-cream); font-size: 1.3rem;
}

/* ---- Main and cards ---- */
.public-main { width: min(1296px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 64px; flex: 1 0 auto; }
.public-auth-wrap { min-height: calc(100vh - 360px); display: flex; justify-content: center; align-items: flex-start; }
.public-guest-stack { width: min(100%, 560px); }
.public-guest-stack > .public-card { width: 100%; }
.public-card {
  width: min(100%, 560px);
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--public-shadow);
}
.public-card .card-header { border-color: var(--public-line); padding: 24px 28px 8px; border-bottom: 0; background: #fff; }
.public-card .card-body { padding: 16px 28px 28px; }
.public-card .card-footer { border-color: var(--public-line); background: var(--public-soft); }
.public-card .card-title, .public-shell h1.card-title {
  font-family: var(--site-display); font-weight: 400; font-size: 30px; letter-spacing: -.02em; color: var(--public-ink);
}

/* ---- Forms ---- */
.public-shell .form-label { color: var(--public-ink); font-weight: 600; font-size: 15px; }
.public-shell .form-control,
.public-shell .form-select {
  min-height: 50px; padding: 0 14px; border: 1px solid #C9CDBB; border-radius: 14px; background-color: #fff;
  color: var(--public-ink); font-size: 16px;
}
.public-shell textarea.form-control { padding: 12px 14px; }
.public-shell .form-control:focus,
.public-shell .form-select:focus { border-color: var(--public-primary); box-shadow: 0 0 0 3px rgba(169, 194, 154, .55); }
.public-shell .btn { border-radius: 999px; font-weight: 600; }
.public-shell .btn-primary {
  --tblr-btn-bg: #2F4A2A; --tblr-btn-border-color: #2F4A2A;
  --tblr-btn-hover-bg: #17221A; --tblr-btn-hover-border-color: #17221A;
  --tblr-btn-active-bg: #17221A; --tblr-btn-active-border-color: #17221A;
  --tblr-btn-color: #F3F0E7; --tblr-btn-hover-color: #F3F0E7;
  min-height: 48px;
}
.public-shell .btn-outline-primary { --tblr-btn-color: #2F4A2A; --tblr-btn-border-color: #2F4A2A; --tblr-btn-hover-bg: #2F4A2A; --tblr-btn-hover-color: #F3F0E7; }
.public-shell .btn-link { color: var(--public-primary); font-weight: 600; }

.public-oauth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #8A9285; font-size: 13px; }
.public-oauth-divider::before,
.public-oauth-divider::after { content: ""; flex: 1; height: 1px; background: #E3E0D6; }
.public-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px;
  border: 1px solid #C9CDBB; border-radius: 999px; background: #fff; color: var(--public-ink); font-weight: 500; text-decoration: none;
}
.public-google-btn:hover { background: #F7F6F0; color: var(--public-ink); text-decoration: none; }
.public-google-btn svg { flex: none; }
.public-google-hint {
  display: flex; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #FBF4E4;
  color: #5A4A2A; font-size: 14px;
}
.public-google-hint i { font-size: 1.05rem; line-height: 1.4; color: #B8860B; flex: none; }

/* ---- Registration funnel and login (templates/funnel_base.html) ---- */
.public-funnel .public-main { width: 100%; padding: 0; }
.funnel { display: flex; flex-direction: column; min-height: 100vh; }
.funnel-aside { background: var(--site-forest); color: var(--site-cream); padding: 0 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.funnel-aside__top { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.funnel-aside__switch a { color: var(--site-sage-light); font-weight: 600; font-size: 15px; }
.funnel-title { margin: 0; font-family: var(--site-display); font-weight: 400; font-size: 36px; line-height: 1.02; letter-spacing: -.03em; color: var(--site-cream); }
.funnel-title em { font-style: italic; color: var(--site-sage); }
.funnel-lead { display: none; margin: 0; font-size: 18px; line-height: 1.6; color: var(--site-on-dark); }
.funnel-benefits { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 6px; font-size: 14px; color: var(--site-on-dark); }
.funnel-benefits li { display: flex; gap: 10px; }
.funnel-benefits li:nth-child(n+3) { display: none; }
.funnel-aside .site-offer {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 14px;
  background: #2A3A2D; border: 1px solid var(--site-sage); font-size: 14px; line-height: 1.4; color: var(--site-cream);
}
.funnel-aside .site-offer svg { flex-shrink: 0; }
.funnel-aside__contact { margin: 0; }
.funnel-contact-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  border: 1px solid #56685A; border-radius: 999px; color: var(--site-cream); font-size: 15px; font-weight: 600; text-decoration: none;
}
.funnel-contact-button:hover { border-color: var(--site-sage); color: var(--site-cream); text-decoration: none; }
.public-brand--dark { flex-grow: 1; }

.funnel-main { flex-grow: 1; padding: 24px 16px 20px; display: flex; flex-direction: column; gap: 20px; }
.funnel-main__switch { display: none; margin: 0; font-size: 15px; color: var(--public-muted); text-align: right; }
.funnel-main__switch a { font-weight: 600; }
.funnel-main__body { flex-grow: 1; display: flex; justify-content: center; }
.funnel-main__column { width: min(100%, 560px); display: flex; flex-direction: column; gap: 20px; }
.funnel-card { padding: 24px 20px; border-radius: 20px; background: #fff; box-shadow: var(--public-shadow); display: flex; flex-direction: column; gap: 20px; }
.funnel-card__head { display: flex; flex-direction: column; gap: 8px; }
.funnel-card__head p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--public-muted); }
.funnel-card__title { margin: 0; font-family: var(--site-display); font-weight: 400; font-size: 28px; letter-spacing: -.02em; color: var(--public-ink); }
.funnel-form { display: flex; flex-direction: column; gap: 18px; }
.funnel-field { display: flex; flex-direction: column; gap: 8px; }
.funnel-field .form-label { margin: 0; }
.funnel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.funnel-optional { font-weight: 400; color: #6F786B; }
.funnel-otp { min-height: 64px !important; font-size: 30px !important; font-weight: 500; letter-spacing: .5em; text-align: center; }
.funnel-submit { width: 100%; min-height: 54px !important; font-size: 17px; }
.funnel-note { margin: 0; font-size: 14px; color: #6F786B; }
.funnel-link-button { padding: 0; border: 0; background: none; color: var(--public-primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.funnel-forgot { margin: -6px 0 0; text-align: right; font-size: 15px; }
.funnel-info { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--site-band); font-size: 14px; line-height: 1.55; color: #2F3A30; }
.funnel-consent .form-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 0; font-size: 14px; line-height: 1.5; color: var(--public-muted); }
.funnel-consent .form-check-input { flex-shrink: 0; width: 22px; height: 22px; margin: 0; border-color: #A7AC9C; }
.funnel-consent .form-check-input:checked { background-color: var(--public-primary); border-color: var(--public-primary); }
.funnel-consent.has-error .form-check-input { border-color: #B42318; }
.funnel-done { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.funnel-done p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--public-muted); }
.funnel-done__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--site-band); display: inline-flex; align-items: center; justify-content: center; }
.funnel-done .funnel-submit { width: auto; padding: 0 28px; display: inline-flex; align-items: center; }
.funnel-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 13px; color: #6F786B; }
.funnel-footer a { color: var(--public-muted); }

/* Step indicator */
.funnel-steps { display: flex; flex-direction: column; gap: 14px; }
.funnel-steps ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.funnel-step { display: flex; flex-direction: column; gap: 10px; }
.funnel-step__bar { height: 6px; border-radius: 999px; background: #DAD6CA; }
.funnel-step.is-done .funnel-step__bar, .funnel-step.is-current .funnel-step__bar { background: var(--site-deep); }
.funnel-step__label { display: flex; align-items: center; gap: 8px; }
.funnel-step__dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 13px; font-weight: 600; border: 1px solid #C9CDBB; color: #8A9285; background: transparent;
}
.funnel-step.is-current .funnel-step__dot { background: #fff; color: var(--site-deep); border-color: var(--site-deep); }
.funnel-step.is-done .funnel-step__dot { background: var(--site-deep); color: var(--site-cream); border-color: var(--site-deep); }
.funnel-step__text { display: none; font-size: 14px; font-weight: 500; color: #8A9285; }
.funnel-step.is-current .funnel-step__text { font-weight: 600; color: var(--public-ink); }
.funnel-step.is-done .funnel-step__text { color: var(--public-ink); }
.funnel-steps__progress { margin: 0; font-size: 15px; color: #6F786B; }
.funnel-steps__current { color: var(--public-ink); margin-right: 4px; }
.funnel-steps__current::after { content: " ·"; font-weight: 400; color: #6F786B; }

@media (min-width: 960px) {
  .funnel { flex-direction: row; }
  .funnel-aside { width: 560px; flex-shrink: 0; padding: 40px 56px 48px; gap: 40px; min-height: 100vh; position: sticky; top: 0; align-self: flex-start; }
  .funnel-aside__top { min-height: 40px; }
  .funnel-aside__switch { display: none; }
  .public-brand--dark .public-brand__tile { width: 40px; height: 40px; border-radius: 12px; }
  .public-brand--dark .public-brand__tile img { width: 26px; height: 29px; }
  .public-brand--dark .public-brand__name { font-size: 22px; }
  .funnel-aside__intro { margin-top: 48px; display: flex; flex-direction: column; gap: 20px; }
  .funnel-title { font-size: 60px; line-height: 1; }
  .funnel-lead { display: block; }
  .funnel-benefits { flex-direction: column; gap: 16px; font-size: 16px; line-height: 1.5; color: var(--site-cream); }
  .funnel-benefits li:nth-child(n+3) { display: flex; }
  .funnel-benefits li::before {
    content: ""; width: 22px; height: 22px; flex-shrink: 0;
    background: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9C29A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  }
  .funnel-aside .site-offer { padding: 14px 16px; border-radius: 16px; font-size: 15px; }
  .funnel-aside__contact { margin-top: auto; }
  .funnel-contact-button { min-height: 52px; padding: 0 26px; font-size: 16px; }
  .funnel-main { padding: 32px 72px 28px; }
  .funnel-main__switch { display: block; }
  .funnel-main__body { align-items: center; }
  .funnel-main__column { gap: 28px; }
  .funnel-card { padding: 36px; border-radius: 24px; }
  .funnel-card__title { font-size: 34px; }
  .funnel-step__text { display: inline; }
  .funnel-steps__current { display: none; }
}

/* ---- Small screens ---- */
@media (max-width: 767.98px) {
  .public-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .public-nav { display: none; }
  .public-nav.is-open {
    position: absolute; left: 0; right: 0; top: 100%;
    display: flex; flex-direction: column; align-items: stretch; gap: 14px;
    padding: 18px 16px 24px; background: var(--site-forest); border-top: 1px solid var(--site-dark-border);
    box-shadow: 0 24px 40px rgba(0, 0, 0, .25);
  }
  .public-nav.is-open .public-nav-link { padding: 8px 0; font-size: 17px; }
  .public-nav.is-open .public-nav-button { width: 100%; }
  .public-main { padding: 24px 0 48px; }
  .public-card .card-header { padding: 20px 20px 4px; }
  .public-card .card-body { padding: 12px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Passkey sign-in button (templates/includes/passkey_login_button.html) */
.public-passkey-btn { margin-top: 10px; font: inherit; cursor: pointer; }
.public-passkey-btn i { font-size: 1.25rem; }
.public-passkey-btn:disabled { opacity: .6; cursor: progress; }

/* 403/404 pages for visitors (templates/partials/error_page.html) */
.public-error-card { width: min(560px, 100%); }
.public-error-card__icon {
  width: 64px; height: 64px; margin: 8px auto 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--public-soft); color: var(--public-primary); font-size: 30px;
}

/* Compact guest footer (polaris_footer_compact in templates/public_base.html).
   Below 992px the offer page shows the fixed .offer-mobile-cart-bar at the
   bottom; keep the footer line (and its upward "Jogi" menu) clear of it. */
@media (max-width: 991.98px) {
  body:has(.offer-mobile-cart-bar) .pf-compact { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Seller logo next to the brand on guest pages (Pro "custom_branding"). */
.public-seller-logo {
  display: block;
  max-width: 140px;
  max-height: 36px;
  margin-right: auto;
  margin-left: 12px;
  object-fit: contain;
}
