/* ==========================================================================
   Tokofy auth pages (admin / vendor login, vendor signup, forgot password)
   Lifted from the tokofy.com marketing site (assets/css/style.css, auth
   section). Everything is scoped under .tk-auth so it cannot leak into the
   admin dashboard, and uses tk- prefixed class names so it does not clash
   with Bootstrap 5 / admin-assets/css/style.css.
   ========================================================================== */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-latin-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

.tk-auth {
  --tk-ink: #111111;
  --tk-ink-2: #2a2d2b;
  --tk-muted: #565c58;
  --tk-green: #1B8A3C;          /* brand green: decoration only */
  --tk-green-ink: #15732F;      /* text + buttons on white */
  --tk-green-dark: #0F5A24;     /* hover */
  --tk-green-50: #EEF7F0;
  --tk-green-100: #D8EEDD;
  --tk-green-bright: #3DBE62;   /* green on #111 */
  --tk-bg: #FFFFFF;
  --tk-bg-soft: #F6F7F5;
  --tk-line: #E4E7E2;
  --tk-line-2: #D3D7D1;
  --tk-danger: #B42318;
  --tk-gutter: clamp(20px, 4vw, 40px);
  --tk-ease: cubic-bezier(.2,.7,.2,1);

  min-height: 100vh;
  display: grid;
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--tk-ink);
  background: var(--tk-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 960px) { .tk-auth { grid-template-columns: 1fr 1fr; } }

.tk-auth *, .tk-auth *::before, .tk-auth *::after { box-sizing: border-box; }
.tk-auth h1, .tk-auth h2 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-family: inherit; color: inherit; text-wrap: balance; }
.tk-auth p { margin: 0; }
.tk-auth ul { margin: 0; padding: 0; list-style: none; }
.tk-auth a { text-decoration: none; }
.tk-auth :focus-visible { outline: 3px solid var(--tk-green); outline-offset: 2px; border-radius: 6px; }
.tk-auth ::selection { background: var(--tk-green-100); }

/* ---------- Left column ---------- */
.tk-auth__main { display: flex; flex-direction: column; padding: 28px var(--tk-gutter) 40px; background: var(--tk-bg); min-width: 0; }
.tk-auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tk-auth__logo { display: inline-flex; }
.tk-auth__logo img { display: block; height: 32px; width: auto; max-width: 100%; }
.tk-auth__form-wrap { width: 100%; max-width: 440px; margin: auto; padding: 40px 0; }
.tk-auth__form-wrap h1 { font-size: clamp(30px, 4vw, 38px); font-weight: 900; color: var(--tk-ink); }
.tk-auth__form-wrap > .tk-auth__sub { margin-top: 10px; color: var(--tk-muted); }

/* language dropdown (existing Bootstrap dropdown, restyled) */
.tk-auth .tk-lang .language-dropdown { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1.5px solid var(--tk-line-2) !important; border-radius: 999px; background: #fff !important; overflow: hidden; }
.tk-auth .tk-lang .language-dropdown img { width: 24px !important; height: 24px; object-fit: cover; border-radius: 50%; }
.tk-auth .tk-lang .dropdown-menu { min-width: 180px; border-radius: 14px !important; }
.tk-auth .tk-lang .dropdown-item img { width: 22px !important; height: 22px; object-fit: cover; border-radius: 50%; }

/* ---------- Form ---------- */
.tk-form { margin-top: 28px; display: grid; gap: 18px; }
.tk-field label, .tk-field .tk-label { display: block; font-weight: 800; font-size: 15px; margin-bottom: 8px; color: var(--tk-ink); }
.tk-field .tk-req { color: var(--tk-danger); }
.tk-field .tk-hint { font-size: 13px; color: var(--tk-muted); margin-top: 6px; }
.tk-field .tk-err, .tk-auth .tk-err { display: block; font-size: 13px; color: var(--tk-danger); font-weight: 700; margin-top: 6px; }
.tk-field .tk-err:empty, .tk-auth .tk-err:empty { display: none; }
.tk-field.has-error .tk-control { border-color: var(--tk-danger); }

.tk-control { display: flex; align-items: center; border: 1.5px solid var(--tk-line-2); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.tk-control:focus-within { border-color: var(--tk-green-ink); box-shadow: 0 0 0 4px rgba(27,138,60,.14); }
.tk-control input, .tk-control select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; box-shadow: none; background: transparent; padding: 14px 16px; font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--tk-ink); }
.tk-control input::placeholder { color: #9aa09c; font-weight: 600; font-size: 16px; opacity: 1; }
.tk-control select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
[dir="rtl"] .tk-control select { padding-right: 16px; padding-left: 40px; background-position: left 14px center; }
.tk-control select option { color: var(--tk-ink); background: #fff; }
.tk-control__prefix { padding: 0 0 0 16px; font-weight: 800; color: var(--tk-muted); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .tk-control__prefix { padding: 0 16px 0 0; }
.tk-control__prefix + input { padding-left: 4px; }
[dir="rtl"] .tk-control__prefix + input { padding-left: 16px; padding-right: 4px; }
.tk-control__suffix { padding: 0 16px 0 4px; font-weight: 800; color: var(--tk-muted); white-space: nowrap; }
[dir="rtl"] .tk-control__suffix { padding: 0 4px 0 16px; }
.tk-control__btn { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; padding: 0 16px; color: var(--tk-muted); font-size: 16px; }
.tk-control__btn:hover { color: var(--tk-ink); }
.tk-control__btn i { color: inherit !important; }

.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tk-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--tk-muted); cursor: pointer; margin: 0; }
.tk-check input { width: 18px; height: 18px; accent-color: var(--tk-green-ink); margin: 2px 0 0; flex: none; cursor: pointer; }
.tk-check a, .tk-link, .tk-auth__alt a { color: var(--tk-green-ink); font-weight: 800; }
.tk-check a:hover, .tk-link:hover, .tk-auth__alt a:hover { color: var(--tk-green-dark); text-decoration: underline; }
.tk-auth__alt { margin-top: 22px; text-align: center; color: var(--tk-muted); }

.tk-captcha { display: grid; gap: 6px; }
.tk-captcha .col-12 { padding: 0; width: auto; }
.tk-captcha .text-danger { font-size: 13px; font-weight: 700; color: var(--tk-danger) !important; }

/* ---------- Buttons ---------- */
.tk-btn {
  --b-bg: var(--tk-ink); --b-fg: #fff; --b-bd: var(--tk-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-family: inherit; font-weight: 800; font-size: 16px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--tk-ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.tk-btn:hover { color: var(--b-fg); transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(17,17,17,.45); }
.tk-btn:active { transform: translateY(0); }
.tk-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.tk-btn svg { width: 18px; height: 18px; flex: none; }
[dir="rtl"] .tk-btn svg { transform: scaleX(-1); }
.tk-btn--green { --b-bg: var(--tk-green-ink); --b-bd: var(--tk-green-ink); }
.tk-btn--green:hover { --b-bg: var(--tk-green-dark); --b-bd: var(--tk-green-dark); box-shadow: 0 8px 18px -8px rgba(21,115,47,.6); }
.tk-btn--ghost { --b-bg: transparent; --b-fg: var(--tk-ink); --b-bd: var(--tk-line-2); }
.tk-btn--ghost:hover { --b-bd: var(--tk-ink); box-shadow: none; }
.tk-btn--lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.tk-btn--block { width: 100%; }

/* sandbox / demo-mode buttons (only rendered when Environment == sendbox) */
.tk-demo { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--tk-line); display: grid; gap: 10px; text-align: center; color: var(--tk-muted); font-size: 14px; }
.tk-demo__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Right column (dark panel) ---------- */
.tk-auth__aside { display: none; position: relative; overflow: hidden; background: var(--tk-ink); color: #fff; padding: 56px; }
@media (min-width: 960px) { .tk-auth__aside { display: flex; flex-direction: column; justify-content: center; } }
.tk-auth__aside::before { content: ""; position: absolute; width: 600px; height: 600px; right: -200px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(61,190,98,.25), transparent 65%); pointer-events: none; }
[dir="rtl"] .tk-auth__aside::before { right: auto; left: -200px; }
.tk-auth__aside > * { position: relative; }
.tk-auth__aside h2 { font-size: clamp(32px, 3.4vw, 44px); font-weight: 900; max-width: 480px; color: #fff; }
.tk-checklist { margin-top: 24px !important; display: grid; gap: 10px; }
.tk-checklist li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: #e6e8e6; font-size: 17px; }
.tk-checklist svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--tk-green-bright); }

/* The admin theme's dark mode (html.dark, toggled from the dashboard and kept in
   localStorage) restyles inputs/selects with !important. Auth pages always use the
   light Tokofy look, so pin the colours back. */
.dark .tk-auth .tk-control input,
.dark .tk-auth .tk-control select { background-color: transparent !important; color: var(--tk-ink) !important; border-color: transparent !important; }
.dark .tk-auth .tk-control input::placeholder { color: #9aa09c !important; }

@media (prefers-reduced-motion: reduce) {
  .tk-auth *, .tk-auth *::before, .tk-auth *::after { transition-duration: .01ms !important; }
}

/* ---------- Store link field (slug + .root suffix) ---------- */
.tk-auth .tk-slug { display: flex; align-items: stretch; border: 1.5px solid var(--tk-line-2); border-radius: 14px; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.tk-auth .tk-slug:focus-within { border-color: var(--tk-green-ink); box-shadow: 0 0 0 4px rgba(27,138,60,.14); }
.tk-auth .tk-slug input { flex: 1; min-width: 7rem; border: 0; outline: 0; background: transparent; padding: 14px 8px 14px 16px; font: inherit; font-size: 16px; font-weight: 800; color: var(--tk-ink); text-align: left; direction: ltr; }
[dir="rtl"] .tk-auth .tk-slug input { text-align: left; direction: ltr; }
.tk-auth .tk-slug input::placeholder { color: #9aa09c; font-weight: 700; }
.tk-auth .tk-slug__status { display: grid; place-items: center; width: 34px; flex: none; }
.tk-auth .tk-slug__status svg { width: 20px; height: 20px; display: none; }
.tk-auth .tk-slug__suffix { display: grid; place-items: center; padding: 0 16px; background: var(--tk-bg-soft); border-left: 1.5px solid var(--tk-line-2); font-weight: 800; color: var(--tk-ink-2); white-space: nowrap; user-select: none; }
@media (max-width: 575.98px) {
  .tk-auth .tk-slug { overflow-x: auto; }
  .tk-auth .tk-slug input { min-width: 8.5rem; padding: 12px 6px 12px 12px; font-size: 16px; text-align: left; }
  .tk-auth .tk-slug__suffix { padding: 0 10px; font-size: 13px; }
  .tk-auth .tk-slug__msg { font-size: 14px; line-height: 1.35; }
}
.tk-auth .tk-slug__msg { min-height: 22px; margin: 8px 0 0; font-size: 14px; font-weight: 800; color: var(--tk-muted); display: flex; align-items: center; gap: 6px; }
.tk-auth .tk-slug__msg svg { width: 16px; height: 16px; flex: none; }
.tk-auth .tk-slug__suggest { display: none; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--tk-muted); }
.tk-auth .tk-slug__suggest button { border: 1.5px solid var(--tk-line-2); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 14px; color: var(--tk-ink); cursor: pointer; }
.tk-auth .tk-slug__suggest button:hover, .tk-auth .tk-slug__suggest button:focus-visible { border-color: var(--tk-green-ink); background: var(--tk-green-50); }
.tk-auth .tk-slug__preview { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--tk-bg-soft); font-size: 14px; font-weight: 700; color: var(--tk-muted); }
.tk-auth .tk-slug__preview svg { width: 16px; height: 16px; color: var(--tk-green-ink); flex: none; }
.tk-auth .tk-slug__preview b { color: var(--tk-ink); font-weight: 900; }
.tk-auth .tk-slug__note { display: none; margin: 6px 0 0; font-size: 13px; color: var(--tk-muted); font-weight: 700; }
.tk-auth .tk-slug-field.is-sanitised .tk-slug__note { display: block; }
.tk-auth .tk-slug__spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--tk-line-2); border-top-color: var(--tk-ink); animation: tk-slug-spin .8s linear infinite; display: none; }
@keyframes tk-slug-spin { to { transform: rotate(360deg); } }
.tk-auth .tk-slug-field[data-state="checking"] .tk-slug__spin { display: block; }
.tk-auth .tk-slug-field[data-state="available"] .tk-slug { border-color: var(--tk-green-ink); }
.tk-auth .tk-slug-field[data-state="available"] .tk-slug__status .i-ok { display: block; color: var(--tk-green-ink); }
.tk-auth .tk-slug-field[data-state="available"] .tk-slug__msg { color: var(--tk-green-ink); }
.tk-auth .tk-slug-field[data-state="taken"] .tk-slug,
.tk-auth .tk-slug-field[data-state="reserved"] .tk-slug,
.tk-auth .tk-slug-field[data-state="invalid"] .tk-slug { border-color: var(--tk-danger); }
.tk-auth .tk-slug-field[data-state="taken"] .tk-slug:focus-within,
.tk-auth .tk-slug-field[data-state="reserved"] .tk-slug:focus-within,
.tk-auth .tk-slug-field[data-state="invalid"] .tk-slug:focus-within { box-shadow: 0 0 0 4px rgba(180,35,24,.12); }
.tk-auth .tk-slug-field[data-state="taken"] .tk-slug__status .i-bad,
.tk-auth .tk-slug-field[data-state="reserved"] .tk-slug__status .i-bad,
.tk-auth .tk-slug-field[data-state="invalid"] .tk-slug__status .i-bad { display: block; color: var(--tk-danger); }
.tk-auth .tk-slug-field[data-state="taken"] .tk-slug__msg,
.tk-auth .tk-slug-field[data-state="reserved"] .tk-slug__msg,
.tk-auth .tk-slug-field[data-state="invalid"] .tk-slug__msg { color: var(--tk-danger); }
.tk-auth .tk-slug-field[data-state="taken"] .tk-slug__suggest,
.tk-auth .tk-slug-field[data-state="reserved"] .tk-slug__suggest { display: flex; }
.tk-auth .tk-slug-field[data-state="error"] .tk-slug__msg { color: #8A5A00; }
.dark .tk-auth .tk-slug input { background-color: transparent !important; color: var(--tk-ink) !important; }

/* ---------- Registration location (country, state, city) ---------- */
.tk-auth .tk-location { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 18px; }
.tk-auth .tk-location__legend { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--tk-muted); }
.tk-auth .tk-only-other { display: none; }
.tk-auth .tk-location:has(#country_choice option[value="Other"]:checked) .tk-only-other { display: block; }
.tk-auth .tk-location:has(#country_choice option[value="Other"]:checked) .tk-only-india { display: none; }
.tk-auth .tk-state-field { position: relative; }
.tk-auth .tk-state-field.is-enhanced .tk-state-native-wrap {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tk-auth .tk-combo { position: relative; }
.tk-auth .tk-combo__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1.5px solid var(--tk-line-2); border-radius: 14px; background: #fff;
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--tk-ink);
  text-align: start; cursor: pointer;
}
.tk-auth .tk-combo__btn svg { width: 16px; height: 16px; flex: none; }
.tk-auth .tk-combo__btn.is-placeholder .tk-combo__value { color: #9aa09c; font-weight: 600; }
.tk-auth .tk-combo.is-open .tk-combo__btn,
.tk-auth .tk-combo__btn:focus-visible { border-color: var(--tk-green-ink); box-shadow: 0 0 0 4px rgba(27,138,60,.14); }
.tk-auth .tk-field.has-error .tk-combo__btn { border-color: var(--tk-danger); }
.tk-auth .tk-combo__pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1.5px solid var(--tk-line-2); border-radius: 14px;
  box-shadow: 0 16px 40px -20px rgba(17,17,17,.45); overflow: hidden;
}
.tk-auth .tk-combo__search {
  display: block; width: calc(100% - 16px); box-sizing: border-box;
  margin: 8px; min-height: 44px; padding: 10px 12px;
  border: 1.5px solid var(--tk-line-2); border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px !important; font-weight: 700; line-height: 1.4; color: var(--tk-ink);
}
.tk-auth .tk-combo__search::placeholder { color: #9aa09c; font-weight: 600; }
.tk-auth .tk-combo__list { max-height: min(320px, 46vh); overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.tk-auth .tk-combo__group {
  padding: 10px 16px 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--tk-muted);
}
.tk-auth .tk-combo__opt {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 16px;
  border: 0; background: transparent; font: inherit; font-size: 16px; font-weight: 700;
  line-height: 1.3; text-align: start; color: var(--tk-ink); cursor: pointer; touch-action: manipulation;
}
.tk-auth .tk-combo__opt.is-active,
.tk-auth .tk-combo__opt:hover,
.tk-auth .tk-combo__opt.is-selected { background: var(--tk-green-50); }
.tk-auth .tk-combo__opt.is-selected { color: var(--tk-green-ink); }
.tk-auth .tk-combo__empty { padding: 16px; font-size: 15px; font-weight: 700; color: var(--tk-muted); }
.dark .tk-auth .tk-combo__btn,
.dark .tk-auth .tk-combo__search,
.dark .tk-auth .tk-combo__pop { background-color: #fff !important; color: var(--tk-ink) !important; }
