/* ==========================================================================
   INSTICK Israel — стили страницы ВХОДА/РЕГИСТРАЦИИ (auth.html)
   Подключается ПОСЛЕ instick-home.css. ДЕМО-интерфейс: без бэкенда.
   Слева (в RTL — справа) панель авторизации, рядом — «клубная» панель
   преимуществ с картой INSTICK CLUB.
   ========================================================================== */

/* ---------- Сетка страницы ------------------------------------------------------ */
.auth { display: grid; gap: 1.4rem; align-items: start; padding-block: 1.6rem 3rem; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } }

/* ---------- Панель авторизации --------------------------------------------------- */
.apanel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: flex; flex-direction: column; gap: 1.1rem;
}
.apanel__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: #161016; }
:root[data-theme="dark"] .apanel__title { color: var(--ink); }

/* Переключатель «כניסה / הרשמה» — сегменты */
.aswitch { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--ground-2); }
.aswitch button {
  flex: 1; padding: .65rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
  color: var(--ink-soft);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.aswitch button[aria-pressed="true"] { background: var(--surface); color: #161016; box-shadow: var(--shadow-soft); }
:root[data-theme="dark"] .aswitch button[aria-pressed="true"] { color: var(--ink); }

/* ---------- Вьюхи (шаги) с плавным появлением ------------------------------------- */
.aview { display: none; flex-direction: column; gap: 1rem; }
.aview.is-in { display: flex; animation: aviewin .35s var(--ease-out); }
@keyframes aviewin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aview.is-in { animation: none; } }
/* Кнопка «назад к выбору способа» */
.aback {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .88rem; font-weight: 500; color: var(--ink-soft);
}
.aback:hover { color: var(--accent); }

/* ---------- Шаг выбора способа: 3 крупные карточки ---------------------------------- */
.amethods { display: flex; flex-direction: column; gap: .6rem; }
.amethod {
  display: flex; align-items: center; gap: .9rem; text-align: start;
  padding: 1.05rem 1.15rem; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
}
.amethod:hover { border-color: #157A44; background: var(--ground-2); transform: translateY(-2px); }
/* Иконка способа — в тонком круге */
.amethod__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.2px solid color-mix(in srgb, var(--ink) 20%, transparent);
  color: #161016;
}
:root[data-theme="dark"] .amethod__icon { color: var(--ink); }
.amethod__icon svg { width: 21px; height: 21px; }
.amethod__body { flex: 1; min-width: 0; }
.amethod__title { display: block; font-family: var(--font-display); font-weight: 600; color: #161016; }
:root[data-theme="dark"] .amethod__title { color: var(--ink); }
.amethod__sub { display: block; font-size: .8rem; color: var(--ink-soft); }
.amethod__go { color: var(--ink-soft); }

/* ---------- Поля форм (общие) --------------------------------------------------------- */
.afield label { display: block; font-size: .88rem; font-weight: 500; margin-block-end: .3rem; color: #161016; }
:root[data-theme="dark"] .afield label { color: var(--ink); }
.afield input {
  width: 100%; padding: .85em 1em; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--ground-2);
  font: inherit; color: var(--ink);
}
.afield input:focus { outline: none; border-color: #157A44; }
.afield.is-error input { border-color: #B3352A; background: color-mix(in srgb, #B3352A 5%, var(--ground-2)); }
.afield__err { display: none; font-size: .78rem; color: #B3352A; margin-block-start: .25rem; }
.afield.is-error .afield__err { display: block; }
.afield--ltr input { direction: ltr; text-align: end; }
/* Поле пароля с кнопкой-глазом */
.apass { position: relative; }
.apass input { padding-inline-end: 3rem; }
.apass__eye {
  position: absolute; inset-inline-end: .5rem; inset-block-start: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: var(--radius);
  display: grid; place-items: center; color: var(--ink-soft);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.apass__eye:hover { background: var(--ground-2); color: #161016; }
.apass__eye svg { width: 18px; height: 18px; }
/* Двухколоночная сетка регистрации */
.afgrid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .afgrid { grid-template-columns: 1fr 1fr; } .afgrid .afield--full { grid-column: 1 / -1; } }

/* Главная зелёная кнопка */
.abtn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .95em 1.4em; border-radius: var(--radius);
  background: #157A44; color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-0);
  box-shadow: 0 8px 20px -10px rgba(21,122,68,.5);
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.abtn:hover { background: #0F6236; transform: translateY(-2px); }
/* Кнопка Google — белая с рамкой и цветной G */
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .9em 1.4em; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); color: #161016;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
:root[data-theme="dark"] .gbtn { color: var(--ink); }
.gbtn:hover { background: var(--ground-2); border-color: var(--ink); }
.gbtn svg { width: 19px; height: 19px; }
.aforgot { font-size: .85rem; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.aforgot:hover { color: var(--accent); }

/* ---------- SMS: ячейки кода + таймер --------------------------------------------------- */
.acode { display: flex; gap: .5rem; justify-content: center; direction: ltr; } /* код вводится слева направо */
.acode input {
  width: 48px; height: 56px; text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.4rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--ground-2); color: var(--ink);
}
.acode input:focus { outline: none; border-color: #157A44; background: var(--surface); }
.atimer { text-align: center; font-size: .85rem; color: var(--ink-soft); }
.atimer b { font-variant-numeric: tabular-nums; }
.atimer button { color: #157A44; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.asent { text-align: center; font-size: .9rem; color: var(--ink-soft); }
.asent b { color: #161016; direction: ltr; unicode-bidi: embed; }
:root[data-theme="dark"] .asent b { color: var(--ink); }

/* ---------- Пароль: индикатор надёжности ----------------------------------------------- */
.astrength { display: flex; flex-direction: column; gap: .3rem; }
.astrength__bars { display: flex; gap: 4px; direction: ltr; }
.astrength__bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--ground-2); transition: background-color .3s var(--ease); }
.astrength[data-level="1"] .astrength__bars i:nth-child(1) { background: #B3352A; }
.astrength[data-level="2"] .astrength__bars i:nth-child(-n+2) { background: #F6A609; }
.astrength[data-level="3"] .astrength__bars i { background: #157A44; }
.astrength__label { font-size: .76rem; color: var(--ink-soft); }

/* Чекбоксы */
.acheck { display: flex; align-items: flex-start; gap: .6rem; font-size: .85rem; color: #2B242B; cursor: pointer; }
:root[data-theme="dark"] .acheck { color: var(--ink); }
.acheck input { width: 17px; height: 17px; margin-block-start: .15rem; accent-color: #157A44; flex: 0 0 auto; }
.acheck a { text-decoration: underline; text-underline-offset: 2px; }
.acheck.is-error { color: #B3352A; }

/* ---------- Экран успеха ------------------------------------------------------------------ */
.asuccess { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .8rem; padding-block: 1rem; }
.asuccess__icon {
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.8rem;
  background: color-mix(in srgb, #157A44 14%, transparent); color: #157A44;
}
.asuccess__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: #161016; }
:root[data-theme="dark"] .asuccess__title { color: var(--ink); }
.asuccess p { color: var(--ink-soft); font-weight: 300; max-width: 38ch; }
/* Купон 5% — пунктирная рамка */
.acoupon {
  display: flex; flex-direction: column; gap: .2rem; align-items: center;
  padding: .9rem 1.6rem; border-radius: var(--radius);
  border: 1.5px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.acoupon small { color: var(--ink-soft); }
.acoupon b { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: .12em; color: var(--accent); direction: ltr; }

/* ==========================================================================
   Панель преимуществ: клубная карта + плитки выгод
   ========================================================================== */
.bpanel {
  border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(150deg, var(--is-cream), #FBE3DC);
  border: 1px solid var(--border);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: flex; flex-direction: column; gap: 1.4rem;
  position: relative;
}
:root[data-theme="dark"] .bpanel { background: var(--surface); }
.bpanel__title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: #161016; }
:root[data-theme="dark"] .bpanel__title { color: var(--ink); }
.bpanel__sub { color: var(--ink-soft); font-weight: 300; margin-block-start: .3rem; }

/* «Клубная карта» INSTICK CLUB: тёмная, с фото-подложкой и лёгким наклоном */
.clubcard {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: #120D14; color: #fff;
  padding: 1.4rem 1.5rem; min-height: 190px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.4rem;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
  transition: transform .4s var(--ease);
}
.clubcard:hover { transform: rotate(0deg) translateY(-4px); }
/* Фото продукта проступает через тёмную плёнку */
.clubcard::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/cherry-watermelon.jpg") center/cover;
  opacity: .22;
}
.clubcard::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 90% at 85% 10%, rgba(239,91,76,.35), transparent 60%);
}
.clubcard > * { position: relative; z-index: 1; }
.clubcard__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.clubcard__top img { height: 24px; border-radius: 3px; }
.clubcard__word { font-family: var(--font-display); font-weight: 600; font-size: .85rem; letter-spacing: .34em; color: #FF9082; direction: ltr; }
/* «Чип» карты */
.clubcard__chip {
  width: 40px; height: 30px; border-radius: 6px;
  background: linear-gradient(135deg, #E8C87A, #C9A24E);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.clubcard__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.clubcard__num { font-family: var(--font-display); font-weight: 500; letter-spacing: .22em; color: rgba(255,255,255,.75); direction: ltr; }
.clubcard__name { font-size: .8rem; color: rgba(255,255,255,.55); }
.clubcard__name b { display: block; color: #fff; font-weight: 600; font-size: .95rem; }

/* Плитки выгод: 2 колонки, тонкие иконки */
.bgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 520px) { .bgrid { grid-template-columns: 1fr; } }
.bitem {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .95rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.bitem:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.bitem__icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent);
}
.bitem__icon svg { width: 18px; height: 18px; }
.bitem b { display: block; font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: #161016; }
:root[data-theme="dark"] .bitem b { color: var(--ink); }
.bitem span { font-size: .78rem; color: var(--ink-soft); }

/* Адаптив: на мобиле панель преимуществ уходит под форму (порядок в DOM) */
@media (max-width: 959px) {
  .clubcard { transform: none; }
}

/* Ошибка кода SMS: блочная и по центру, но hidden честно скрывает */
.acode-err { display: block; text-align: center; }
.acode-err[hidden] { display: none; }

/* ==========================================================================
   MODX Login / Register integration
   ========================================================================== */
.auth-form { display:flex; flex-direction:column; gap:1rem; }
.auth-form--register { margin-top:.9rem; }
.auth-message { padding:.85rem 1rem; border-radius:var(--radius); font-size:.88rem; line-height:1.6; }
.auth-message--error { border:1px solid rgba(179,53,42,.3); background:rgba(179,53,42,.07); color:#B3352A; }
.auth-message--success { border:1px solid rgba(21,122,68,.3); background:rgba(21,122,68,.08); color:#0F6236; }
.auth-select {
  width:100%; padding:.85em 1em; border-radius:var(--radius);
  border:1.5px solid var(--border); background:var(--ground-2);
  color:var(--ink); font:inherit;
}
.auth-select:focus { outline:none; border-color:#157A44; }
.afield small { color:var(--ink-soft); font-weight:400; }
.auth-honeypot { position:absolute!important; inline-size:1px!important; block-size:1px!important; overflow:hidden!important; clip-path:inset(50%)!important; }
.auth-logout-form { display:flex; justify-content:center; }
.auth--logged { grid-template-columns:1fr; max-width:680px; margin-inline:auto; }
.afield__err:empty { display:none!important; }
.afield.is-error .afield__err:not(:empty) { display:block; }

/* ==========================================================================
   Password recovery
   ========================================================================== */
.auth-recovery-page { padding-block:1.6rem 3rem; }
.auth-recovery-panel { max-width:620px; margin-inline:auto; }
.auth-reset-card { display:flex; flex-direction:column; gap:1rem; }
.auth-reset-head { display:flex; flex-direction:column; gap:.35rem; }
.auth-reset-head p,
.auth-reset-card > p { color:var(--ink-soft); line-height:1.7; }
.auth-reset-back { align-self:center; color:var(--ink-soft); font-size:.86rem; text-decoration:underline; text-underline-offset:3px; }
.auth-reset-back:hover { color:#157A44; }
.auth-reset-success { align-items:center; text-align:center; padding-block:.5rem; }
.auth-reset-success .abtn { max-width:280px; }
.auth-reset-warning { width:68px; height:68px; display:grid; place-items:center; border-radius:50%; background:rgba(246,166,9,.13); color:#B77800; font-size:2rem; font-weight:700; }
