/* ============================================================
   KeepKash — Auth pages (Sign up / Log in)
   Tokens come from keepkash-home.css :root.
   This file adds auth-only component classes.
   ============================================================ */

/* ── Page wrapper ────────────────────────────────────────────── */
.kk-auth-page {
  padding-block: 48px 64px;
  background: var(--kk-paper);
}

/* ── Shell ──────────────────────────────────────────────────── */
.kk-auth-shell {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  min-height: 580px;
}

/* ── Brand Panel ─────────────────────────────────────────────── */
.kk-auth-panel {
  position: relative;
  overflow: hidden;
  padding: 44px;
  background: linear-gradient(150deg, var(--kk-purple-dark) 0%, var(--kk-purple) 52%, #8A7AF5 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kk-auth-panel__deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.kk-auth-panel__deco--1 {
  width: 320px; height: 320px;
  background: rgba(255,255,255,0.07);
  top: -110px;
  inset-inline-end: -60px;
}
.kk-auth-panel__deco--2 {
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  bottom: 40px;
  inset-inline-start: -70px;
}

/* Logo */
.kk-auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.kk-auth-logo__icon { height: 38px; width: auto; filter: brightness(0) invert(1); display: block; }
.kk-auth-logo__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -0.045em;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}
.kk-auth-logo__kash { color: #9FD66A; }

/* Live-stat pill */
.kk-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 36px;
  backdrop-filter: blur(6px);
}
.kk-auth-pill__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--kk-mint);
  box-shadow: 0 0 10px var(--kk-mint);
  flex-shrink: 0;
}

/* Headline */
.kk-auth-panel__headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 20px 0 0;
  color: #fff;
}
[lang="ar"] .kk-auth-panel__headline {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}
.kk-auth-panel__highlight { color: var(--kk-butter); }

/* Body */
.kk-auth-panel__body {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  max-width: 330px;
  margin-top: 18px;
}

/* ── Wallet card ─────────────────────────────────────────────── */
.kk-auth-wallet {
  position: relative;
  z-index: 2;
  margin-top: 32px;
}
.kk-auth-wallet__card {
  /* This card is a fixed light "wallet screenshot" mockup -- background never
     darkens, so its text colors below are pinned to literal light-mode values
     instead of the theme-aware --kk-ink/--kk-green tokens, which would
     otherwise flip toward white in dark mode and vanish against this card. */
  background: rgba(255,255,255,0.97);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 26px 50px -20px rgba(0,0,0,0.45);
  color: #2A2A2A;
}
.kk-auth-wallet__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kk-auth-wallet__label {
  font-size: 11.5px;
  font-weight: 600;
  color: #6B6B6B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[lang="ar"] .kk-auth-wallet__label {
  text-transform: none;
  letter-spacing: 0;
}
.kk-auth-wallet__icon { height: 20px; width: auto; display: block; }
.kk-auth-wallet__balance-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.kk-auth-wallet__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: #2A2A2A;
}
.kk-auth-wallet__earned {
  font-size: 12.5px;
  font-weight: 700;
  color: #6FA831;
}
.kk-auth-wallet__divider {
  height: 1px;
  background: #ECE5D2;
  margin: 13px 0;
}
.kk-auth-wallet__row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 0;
}
.kk-auth-wallet__avatar {
  width: 30px; height: 30px;
  border-radius: 9px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.kk-auth-wallet__store-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #2A2A2A;
}
.kk-auth-wallet__store-amt {
  font-size: 13px;
  font-weight: 800;
  color: #6FA831;
  font-family: var(--font-display);
}

/* ── Form column ─────────────────────────────────────────────── */
.kk-auth-form-col {
  background: var(--kk-paper);
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kk-auth-form-inner {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── Auth header ─────────────────────────────────────────────── */
.kk-auth-header__h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--kk-ink);
  margin: 0;
  line-height: 1.15;
}
[lang="ar"] .kk-auth-header__h1 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}
.kk-auth-header__sub {
  font-size: 14.5px;
  color: var(--kk-ink-soft);
  margin: 8px 0 0;
  line-height: 1.5;
  max-width: 380px;
}

/* ── Form body (gap between rows) ────────────────────────────── */
.kk-auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Social row ──────────────────────────────────────────────── */
.kk-social-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kk-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  background: var(--kk-paper);
  border: 1.5px solid var(--kk-line);
  border-radius: 12px;
  cursor: pointer;
  color: var(--kk-ink);
  transition: border-color 0.15s, background 0.15s;
}
.kk-social-btn:hover {
  border-color: var(--kk-ink-very);
  background: var(--kk-field);
}

/* ── "or" divider ────────────────────────────────────────────── */
.kk-or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
}
.kk-or-divider__line {
  flex: 1;
  height: 1px;
  background: var(--kk-line);
}
.kk-or-divider__label {
  font-size: 12px;
  color: var(--kk-ink-very);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Field ───────────────────────────────────────────────────── */
.kk-field {
  display: block;
}
.kk-field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.kk-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--kk-ink);
  font-family: var(--font-body);
}
.kk-field__forgot,
.kk-field__label-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--kk-purple);
  text-decoration: none;
}
.kk-field__forgot:hover,
.kk-field__label-link:hover { text-decoration: underline; }

.kk-field__shell {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--kk-field);
  border: 1.5px solid var(--kk-line);
  border-radius: 13px;
  padding: 0 14px;
  height: 50px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kk-field__shell:focus-within {
  border-color: var(--kk-purple);
  box-shadow: 0 0 0 4px var(--kk-purple-soft);
}
.kk-field__shell:focus-within .kk-field__icon { color: var(--kk-purple); }

.kk-field__icon {
  display: flex;
  color: var(--kk-ink-very);
  flex-shrink: 0;
  transition: color 0.15s;
}
.kk-field__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--kk-ink);
  font-family: var(--font-body);
  height: 100%;
}
.kk-field__input::placeholder { color: #B8B2A4; }

/* Textareas (e.g. Invite's "Message" field) aren't wrapped in .kk-field__shell -- that shell is a
   fixed-height 50px flex row built for single-line inputs. Give the textarea its own box directly
   so it still gets the same visual language (field background, border, focus ring). */
textarea.kk-field__input {
  display: block;
  width: 100%;
  height: auto;
  background: var(--kk-field);
  border: 1.5px solid var(--kk-line);
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.kk-field__input:focus {
  border-color: var(--kk-purple);
  box-shadow: 0 0 0 4px var(--kk-purple-soft);
}

.kk-field__eye {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--kk-ink-very);
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}
.kk-field__eye:focus-visible { outline: 2px solid var(--kk-purple); border-radius: 4px; }

.kk-field__hint {
  display: block;
  font-size: 11.5px;
  color: var(--kk-ink-very);
  margin-top: 6px;
}

/* Validation error state */
.kk-field--error .kk-field__shell {
  border-color: #D94040;
  box-shadow: 0 0 0 4px rgba(217,64,64,0.12);
}
.kk-field__error {
  display: block;
  font-size: 11.5px;
  color: #D94040;
  margin-top: 6px;
}

/* ── Phone field ─────────────────────────────────────────────── */
.kk-phone-shell {
  display: flex;
  align-items: center;
  background: var(--kk-field);
  border: 1.5px solid var(--kk-line);
  border-radius: 13px;
  height: 50px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kk-phone-shell:focus-within {
  border-color: var(--kk-purple);
  box-shadow: 0 0 0 4px var(--kk-purple-soft);
}
.kk-phone-prefix {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  height: 100%;
  background: var(--kk-paper);
  border-inline-end: 1.5px solid var(--kk-line);
  flex-shrink: 0;
}
.kk-phone-prefix__code {
  font-size: 14px;
  font-weight: 600;
  color: var(--kk-ink);
}
.kk-phone-prefix__chevron { color: var(--kk-ink-very); display: flex; }
.kk-phone-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--kk-ink);
  font-family: var(--font-body);
  height: 100%;
  padding: 0 14px;
}
.kk-phone-input::placeholder { color: #B8B2A4; }

/* ── Checkbox row ────────────────────────────────────────────── */
.kk-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.kk-check-row__input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}
.kk-check-row__box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--kk-line);
  background: var(--kk-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.12s, border-color 0.12s;
}
.kk-check-row__input:checked ~ .kk-check-row__box {
  background: var(--kk-green);
  border-color: var(--kk-green);
}
.kk-check-row__tick {
  display: none;
}
.kk-check-row__input:checked ~ .kk-check-row__box .kk-check-row__tick {
  display: block;
}
.kk-check-row__label {
  font-size: 12.5px;
  color: var(--kk-ink-soft);
  line-height: 1.45;
}
.kk-check-row__label a {
  color: var(--kk-purple);
  font-weight: 600;
  text-decoration: none;
}
.kk-check-row__label a:hover { text-decoration: underline; }

/* ── $5 Bonus banner ─────────────────────────────────────────── */
.kk-bonus-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, var(--kk-green-soft), rgba(205,239,217,0.53));
  border: 1.5px solid rgba(111,168,49,0.2);
  border-radius: 14px;
  padding: 12px 14px;
}
[dir="rtl"] .kk-bonus-banner {
  background: linear-gradient(270deg, var(--kk-green-soft), rgba(205,239,217,0.53));
}
.kk-bonus-banner__chip {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--kk-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -6px var(--kk-green);
}
.kk-bonus-banner__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--kk-green-dark);
  letter-spacing: -0.01em;
}
.kk-bonus-banner__sub {
  font-size: 12px;
  color: var(--kk-ink-soft);
  margin-top: 1px;
}

/* ── Primary CTA ─────────────────────────────────────────────── */
.kk-primary-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kk-primary-btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .kk-primary-btn { transition: none; } }

.kk-primary-btn--green {
  background: var(--kk-green);
  box-shadow: 0 10px 24px -10px rgba(111,168,49,0.67);
}
.kk-primary-btn--purple {
  background: var(--kk-purple);
  box-shadow: 0 10px 24px -10px rgba(110,93,218,0.67);
}

/* ── Magic-link button ───────────────────────────────────────── */
.kk-magic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 48px;
  background: var(--kk-purple-soft);
  border: 1.5px solid rgba(110,93,218,0.13);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--kk-purple-dark);
  transition: background 0.15s, border-color 0.15s;
}
.kk-magic-btn:hover { background: var(--kk-purple-soft); border-color: rgba(110,93,218,0.25); }

/* ── Mode switch ─────────────────────────────────────────────── */
.kk-mode-switch {
  text-align: center;
  font-size: 14px;
  color: var(--kk-ink-soft);
}
.kk-mode-switch a {
  color: var(--kk-purple);
  font-weight: 700;
  text-decoration: none;
}
.kk-mode-switch a:hover { text-decoration: underline; }

/* ── Error alert ─────────────────────────────────────────────── */
.kk-auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.kk-auth-alert--error {
  background: #FEF2F2;
  border: 1.5px solid rgba(217,64,64,0.2);
  color: #B91C1C;
}
[data-theme="dark"] .kk-auth-alert--error {
  background: #2A1414;
  border-color: rgba(217,64,64,0.35);
  color: #F5A3A3;
}
.kk-auth-alert--success {
  background: var(--kk-green-soft);
  border: 1.5px solid rgba(111,168,49,0.25);
  color: var(--kk-green-dark);
}

/* ── Jordan flag SVG helper ──────────────────────────────────── */
.kk-flag {
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* ── Responsive: stack below 880px ──────────────────────────── */
@media (max-width: 879px) {
  .kk-auth-page {
    padding-block: 24px 40px;
  }
  .kk-auth-shell {
    grid-template-columns: 1fr;
    border-radius: 16px;
    min-height: 0;
  }
  .kk-auth-panel {
    padding: 28px 24px;
    min-height: 0;
  }
  .kk-auth-panel__headline { font-size: 28px; }
  .kk-auth-wallet { display: none; }
  .kk-auth-panel__body { max-width: none; }
  .kk-auth-form-col {
    padding: 36px 24px;
    justify-content: flex-start;
  }
}
