/* Auth pages (login / signup / forgot / reset) — one shared design.
   Light editorial theme; uses securebuy-tokens.css vars with safe fallbacks.
   Not part of the frozen dashboard CSS. */

.sb-auth {
  margin: 0;
  background: var(--sb-surface-cream, #f6f4ef);
  color: var(--sb-ink, #17181a);
  min-height: 100dvh;
}

.sb-auth-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top row: logo + language pill */
.sb-auth-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}
.sb-auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 24, 26, 0.14);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.sb-auth-flag { width: 18px; height: 18px; border-radius: 3px; }

/* Heading */
.sb-auth-head h1 {
  margin: 8px 0 4px;
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.sb-auth-head p {
  margin: 0;
  color: var(--sb-ink-soft, #5b5c5e);
  font-size: 1.02rem;
}

/* Illustration */
.sb-auth-art { margin: 4px 0; }
.sb-auth-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

/* Form body */
.sb-auth-body { display: flex; flex-direction: column; }

.sb-field { display: block; margin-bottom: 16px; }
.sb-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sb-ink, #17181a);
}
.sb-field-hint {
  display: block;
  margin-top: 7px;
  font-size: 0.8rem;
  color: var(--sb-ink-soft, #6b6c6e);
}

/* Input with leading icon + optional trailing toggle */
.sb-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid rgba(23, 24, 26, 0.16);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sb-input:focus-within {
  border-color: var(--sb-accent, #7ba814);
  box-shadow: 0 0 0 3px rgba(123, 168, 20, 0.16);
}
.sb-input-ico { width: 22px; height: 22px; color: var(--sb-ink-soft, #6b6c6e); flex: 0 0 auto; }
.sb-input-prefix { flex: 0 0 auto; font-weight: 600; color: var(--sb-ink, #17181a); }
.sb-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
  color: inherit;
  padding: 16px 0;
}
.sb-input input::placeholder { color: #9a9b9d; }

.sb-pw-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--sb-ink-soft, #6b6c6e);
  cursor: pointer;
  border-radius: 10px;
}
.sb-pw-toggle .ico-hide { display: none; }
.sb-pw-toggle.is-shown .ico-show { display: none; }
.sb-pw-toggle.is-shown .ico-hide { display: block; }

.sb-field-aux { display: flex; justify-content: flex-end; margin: -4px 0 18px; }

.sb-auth-link,
.sb-auth-alt a {
  color: var(--sb-accent, #6f9a10);
  font-weight: 700;
  text-decoration: none;
}
.sb-auth-link:hover, .sb-auth-alt a:hover { text-decoration: underline; }

/* Primary submit (reuses .sb-btnx.sb-btnx-primary from components) */
.sb-auth-submit {
  width: 100%;
  min-height: 60px;
  border: 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.sb-auth-submit .grow { flex: 0 1 auto; }

/* "or" divider */
.sb-auth-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 12px;
  color: var(--sb-ink-soft, #6b6c6e);
  font-size: 0.9rem;
}
.sb-auth-or::before, .sb-auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(23, 24, 26, 0.14);
}

.sb-auth-alt { margin: 4px 0 0; text-align: center; color: var(--sb-ink-soft, #5b5c5e); font-size: 0.98rem; }

/* Login-specific: place illustration as background under form layer */
.sb-auth--login .sb-auth-art {
  display: none;
}

.sb-auth--login .sb-auth-body {
  position: relative;
  z-index: 0;
  padding-top: 220px;
}

.sb-auth--login .sb-auth-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 210px;
  background: url("/static/img/auth/login-illustration-reference.png") center top / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}

.sb-auth--login .sb-auth-body form,
.sb-auth--login .sb-auth-or,
.sb-auth--login .sb-auth-alt {
  position: relative;
  z-index: 1;
}

/* Signup-specific: place illustration as background under form layer */
.sb-auth--signup .sb-auth-art {
  display: none;
}

.sb-auth--signup .sb-auth-body {
  position: relative;
  z-index: 0;
  padding-top: 220px;
}

.sb-auth--signup .sb-auth-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 210px;
  background: url("/static/img/auth/signup-illustration-reference.png") center top / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}

.sb-auth--signup .sb-auth-body form,
.sb-auth--signup .sb-auth-or,
.sb-auth--signup .sb-auth-alt {
  position: relative;
  z-index: 1;
}

/* Forgot-password-specific: place illustration as background under form layer */
.sb-auth--forgot .sb-auth-art {
  display: none;
}

.sb-auth--forgot .sb-auth-body {
  position: relative;
  z-index: 0;
  padding-top: 220px;
}

.sb-auth--forgot .sb-auth-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 210px;
  background: url("/static/img/auth/forgot-illustration-reference.png") center top / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}

.sb-auth--forgot .sb-auth-body form,
.sb-auth--forgot .sb-auth-or,
.sb-auth--forgot .sb-auth-alt,
.sb-auth--forgot .sb-auth-notice {
  position: relative;
  z-index: 1;
}

/* Messages */
.sb-auth-error, .sb-auth-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.sb-auth-error { background: #fdecec; color: #9b1c1c; }
.sb-auth-notice { background: #eef7dd; color: #3f6212; }

@media (min-width: 480px) {
  .sb-auth-wrap { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
