/* ═══════════════════════════════════════════════════════════════════
   CommerCentr — Auth (login / register / forgot)
   Shared by the static login page AND the in-place modal.
   Markup is identical; .auth-shell hosts the card on both surfaces.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Full-page shell (static login) ──────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg-page);
}
@media (max-width: 860px) { .auth-page { grid-template-columns: 1fr; } }

.auth-aside {
  position: relative;
  padding: var(--sp-8) var(--sp-8) var(--sp-7);
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 100% 0, rgba(200,255,0,.10), transparent 55%),
    linear-gradient(180deg, var(--gray-85), var(--bg-page));
  border-right: 1px solid var(--gray-60);
  overflow: hidden;
}
@media (max-width: 860px) { .auth-aside { display: none; } }
.auth-aside__brand { display: inline-flex; align-items: center; gap: 10px; }
.auth-aside__brand-text { font-family: var(--font-display); font-size: 19px; color: var(--gray-0); }
.auth-aside__brand-text b { color: var(--cc-lime); }
.auth-aside__lead {
  margin-top: auto;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 3vw, 40px); line-height: 1.05; color: var(--gray-0); letter-spacing: -.5px;
}
.auth-aside__lead b { color: var(--cc-lime); }
.auth-aside__sub { margin-top: var(--sp-4); color: var(--fg-muted); font-size: 14px; max-width: 380px; line-height: 1.55; }
.auth-aside__stats { display: flex; gap: var(--sp-6); margin-top: var(--sp-6); }
.auth-aside__stats .v { font-family: var(--font-display); font-size: 22px; color: var(--cc-lime); }
.auth-aside__stats .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); margin-top: 4px; }
.auth-aside__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(80% 60% at 100% 0, #000, transparent 70%);
          mask-image: radial-gradient(80% 60% at 100% 0, #000, transparent 70%);
}
.auth-pane { display: flex; align-items: center; justify-content: center; padding: var(--sp-7) var(--sp-6); }

/* ── The card (shared) ───────────────────────────────────────── */
.auth-card { width: 100%; max-width: 400px; }
.auth-card__head { margin-bottom: var(--sp-5); }
.auth-card__title { font-family: var(--font-display); font-size: 24px; color: var(--gray-0); }
.auth-card__sub { color: var(--fg-muted); font-size: 13px; margin-top: 6px; }

/* social row */
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-social--stack { grid-template-columns: 1fr; }
.auth-social button {
  height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--gray-80); border: 1px solid var(--gray-60); border-radius: var(--radius);
  color: var(--gray-10); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: var(--t-fast);
}
.auth-social button:hover { border-color: var(--gray-50); background: var(--gray-70); }
.auth-social svg { width: 18px; height: 18px; }

.auth-sep { display: flex; align-items: center; gap: 14px; margin: var(--sp-5) 0; color: var(--fg-faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--gray-60); }

/* fields */
.auth-field { margin-bottom: var(--sp-4); }
.auth-field > label { display: block; font-size: 12px; color: var(--fg-secondary); font-weight: 500; margin-bottom: 6px; }
.auth-ipt {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--bg-page); border: 1px solid var(--gray-60); border-radius: var(--radius);
  color: var(--gray-0); font-size: 15px; font-family: var(--font-primary); transition: var(--t-fast);
}
.auth-ipt::placeholder { color: var(--fg-faint); }
.auth-ipt:focus { outline: none; border-color: var(--cc-lime); box-shadow: var(--focus-glow); }
.auth-ipt--pw { padding-right: 44px; }
.auth-pw { position: relative; }
.auth-pw__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius); }
.auth-pw__eye:hover { color: var(--gray-10); }
.auth-pw__eye svg { width: 18px; height: 18px; }
.auth-pw__eye.is-shown { color: var(--cc-lime); }
/* Кубик-генератор надійного пароля (ліворуч від ока; лише на signup-полях). */
.auth-pw--gen .auth-ipt--pw { padding-right: 78px; }
.auth-pw__gen { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius); }
.auth-pw__gen:hover { color: var(--cc-lime); }
.auth-pw__gen svg { width: 18px; height: 18px; }
.auth-pw__gen.spin svg { animation: auth-roll .5s ease; }
@keyframes auth-roll { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* Тост-сповіщення (генерація/копіювання пароля). */
.auth-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); z-index: 300; max-width: 90vw; padding: 11px 16px; display: inline-flex; align-items: center; gap: 9px; background: var(--surface-2, #12181a); color: var(--gray-10); border: 1px solid var(--cc-lime); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.auth-toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-toast svg { color: var(--cc-lime); flex: none; }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-secondary); cursor: pointer; user-select: none; }
.auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.auth-check__box { width: 18px; height: 18px; border: 1px solid var(--gray-50); border-radius: var(--radius); background: var(--bg-page); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--t-fast); }
.auth-check input:checked + .auth-check__box { background: var(--cc-lime); border-color: var(--cc-lime); }
.auth-check__box svg { width: 12px; height: 12px; color: var(--gray-100); opacity: 0; }
.auth-check input:checked + .auth-check__box svg { opacity: 1; }
.auth-link { font-size: 13px; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.auth-link:hover { color: var(--primary-50); text-decoration: underline; }

.auth-submit { width: 100%; height: 48px; font-size: 15px; }
.auth-foot { text-align: center; margin-top: var(--sp-5); font-size: 13px; color: var(--fg-muted); }
.auth-foot .auth-link { font-weight: 600; }

.auth-legal { margin-top: var(--sp-5); font-size: 11px; color: var(--fg-faint); line-height: 1.5; text-align: center; }
.auth-legal a { color: var(--fg-muted); text-decoration: underline; }

/* validation */
.auth-field.is-error .auth-ipt { border-color: var(--error); }
.auth-err { display: none; color: var(--error); font-size: 11.5px; margin-top: 6px; }
.auth-field.is-error .auth-err { display: block; }
.auth-note { display: none; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--success-light); border: 1px solid rgba(43,176,74,.3); color: var(--gray-10); font-size: 13px; line-height: 1.5; margin-bottom: var(--sp-4); }
.auth-note.show { display: flex; }
.auth-note svg { width: 18px; height: 18px; color: var(--success-fg); flex-shrink: 0; margin-top: 1px; }

/* view toggling (login / register / forgot) */
[data-auth-view] { display: none; }
[data-auth-view].active { display: block; }

/* ── Modal surface ───────────────────────────────────────────── */
.auth-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.auth-modal.open { display: flex; }
.auth-modal__scrim { position: absolute; inset: 0; background: rgba(3,4,4,.74); backdrop-filter: blur(4px); animation: authFade .2s ease; }
.auth-modal__box {
  position: relative; width: 100%; max-width: 432px;
  background: var(--gray-85); border: 1px solid var(--gray-60); border-radius: var(--radius-lg);
  padding: var(--sp-6); box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: authRise .26s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius); }
.auth-modal__x:hover { background: rgba(255,255,255,.06); color: var(--gray-10); }
.auth-modal__x svg { width: 18px; height: 18px; }
.auth-modal__brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: var(--sp-5); }
.auth-modal__brand-text { font-family: var(--font-display); font-size: 16px; color: var(--gray-0); }
.auth-modal__brand-text b { color: var(--cc-lime); }

@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes authRise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-modal__box, .auth-modal__scrim { animation: none; } }

/* ─── Модалка вітрини (blocks у footer.tpl + www/js/auth-modal.js) ───────────
   Таби «Вхід / Реєстрація», рядок помилки та honeypot. Живуть тут, а не окремим
   файлом: решта .auth-* уже тут, а модалка вітрини свідомо переюзує ці класи. */
.auth-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: var(--sp-5);
	background: var(--bg-sunken, rgba(255,255,255,.04)); border-radius: 10px; }
.auth-tab { flex: 1; height: 36px; border: 0; border-radius: 8px; cursor: pointer;
	background: transparent; color: var(--fg-muted); font-size: 13px; font-weight: 600;
	font-family: inherit; transition: background .15s ease, color .15s ease; }
.auth-tab:hover { color: var(--gray-0); }
.auth-tab[aria-selected="true"] { background: var(--bg-raised, rgba(255,255,255,.09)); color: var(--gray-0); }
.auth-tab:focus-visible { outline: none; box-shadow: var(--focus-glow); }

/* Порожній — місця не займає; текст з'являється лише коли JS його поклав. */
.auth-msg { color: var(--error); font-size: 12.5px; margin-bottom: var(--sp-3); }
.auth-msg:empty { display: none; }

/* Honeypot: невидимий для людини, але НЕ display:none — частина ботів такі поля пропускає. */
.auth-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px;
	overflow: hidden; opacity: 0; pointer-events: none; }

/* Chrome/Edge автозаповнення силоміць малює поле світлим (rgb(232,240,254)) — темне поле
   стає білим, і лаймове «показане» око на ньому зникає (скарга 2026-07-22). Кольору ока це
   не стосується: лікуємо причину — пінимо фон і текст. `box-shadow: inset` — єдиний спосіб
   перебити автозаповнення, `background` браузер ігнорує; довгий transition тримає фон і
   після зміни значення. */
.auth-ipt:-webkit-autofill,
.auth-ipt:-webkit-autofill:hover,
.auth-ipt:-webkit-autofill:focus,
.auth-ipt:-webkit-autofill:active {
	-webkit-text-fill-color: var(--gray-0);
	-webkit-box-shadow: 0 0 0 1000px var(--bg-page) inset;
	box-shadow: 0 0 0 1000px var(--bg-page) inset;
	caret-color: var(--gray-0);
	transition: background-color 600000s 0s ease;
}

/* В'ю без вкладок (відновлення пароля) — має власний заголовок усередині. */
.auth-modal--plain .auth-card__head--main,
.auth-modal--plain .auth-tabs { display: none; }
