/* ============================================================
   AUTH — page shell (split ink visual / white form panel) and
   every component the sign-in/create-account page uses. Tokens
   (colors, fonts) come from .site-shell, css/shared/site-shell.css —
   this file is page-specific, same pattern as css/home/layout.css,
   css/checkout/layout.css, etc.
   ============================================================ */

.auth-split {
  min-height: 100vh;
  display: flex;
}

/* ---------- Visual panel (ink field, the 30) ---------- */

.auth-visual {
  flex: 1 1 50%;
  min-width: 0;
  background: var(--field);
  color: var(--on-field);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 4vw, 56px);
}

.auth-visual__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-field);
  text-decoration: none;
}

.auth-visual__wordmark {
  font: 800 1.5rem/1 var(--font-sans);
  letter-spacing: -0.045em;
}

.auth-visual__copy {
  max-width: 440px;
}

.site-shell .auth-visual__heading {
  font: 600 clamp(2rem, 3.4vw, 3rem)/1.08 var(--font-sans);
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.auth-visual__lead {
  font: 400 clamp(1.0625rem, 1.25vw, 1.1875rem)/1.55 var(--font-sans);
  color: var(--on-field-2);
  max-width: 46ch;
  margin: 0;
}

.auth-visual__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  font: 500 0.8125rem/1.3 var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-field-2);
}

/* ---------- Form panel (white, the 60) ---------- */

.auth-form-panel {
  flex: 0 0 min(560px, 46vw);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px);
  border-left: 1px solid var(--line);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.site-shell .auth-eyebrow {
  margin: 0 0 12px;
  font: 500 0.8125rem/1.2 var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.site-shell .auth-heading {
  margin: 0 0 clamp(24px, 4vw, 32px);
  font: 600 2rem/1.15 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 14px;
  font: 500 0.8125rem/1.2 var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.25s;
}

.tab-underline {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Forms / fields ---------- */

.auth-form { display: flex; flex-direction: column; gap: 20px; }
#registerForm { display: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-row { display: flex; gap: 14px; }
.field-row > .field { flex: 1; }

.field label {
  font: 500 0.875rem/1.2 var(--font-sans);
  color: var(--text);
}

.input-wrap { position: relative; }

.z-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--text-2);
  background: var(--white);
  color: var(--text);
  font: 400 1rem/1.4 var(--font-sans);
  outline: none;
  transition: border-color 0.25s;
}

.z-input::placeholder { color: var(--text-2); opacity: 0.6; }

.z-input--pw { padding-right: 60px; }

.z-input:hover { border-color: var(--text); }

.z-input:focus {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Password toggle ---------- */

.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font: 500 0.75rem/1.2 var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s;
}

.pw-toggle:hover { color: var(--text); }

/* ---------- Buttons ---------- */

.btn-primary {
  width: 100%;
  margin-top: 4px;
  height: 46px;
  border-radius: 0;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font: 500 0.875rem/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s;
}

.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 12px 22px;
  border-radius: 0;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font: 500 0.875rem/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}

.btn-ghost:hover { background: var(--text); color: var(--white); }

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  font: 500 0.875rem/1.2 var(--font-sans);
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s;
}

.btn-social:hover { border-color: var(--text); background: var(--mist); }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: 500 0.8125rem/1.2 var(--font-sans);
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.btn-link:hover { text-decoration-thickness: 2px; }

/* ---------- Checkbox ---------- */

.checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid var(--text-2);
  border-radius: 0;
  transition: border-color 0.2s, background-color 0.2s;
}

.checkbox.is-checked {
  background: var(--ink);
  border-color: var(--ink);
}

.checkbox.is-checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--on-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Remember / terms rows ---------- */

.remember-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.remember { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.remember-label { font: 400 0.875rem/1.2 var(--font-sans); color: var(--text-2); }

.terms { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.terms-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.terms-check > .checkbox { margin-top: 2px; }
.terms-label { font: 400 0.875rem/1.5 var(--font-sans); color: var(--text-2); }

.terms-label .btn-link { font-size: inherit; letter-spacing: inherit; }

/* ---------- Divider ---------- */

.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.divider-line { flex: 1; height: 1px; background: var(--line); }
.divider-text {
  font: 500 0.75rem/1.2 var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.social-row { display: flex; gap: 12px; }

/* ---------- Form footer ---------- */

.form-footer {
  margin-top: 28px;
  text-align: center;
  font: 400 0.875rem/1.3 var(--font-sans);
  color: var(--text-2);
}

.form-footer .btn-link { margin-left: 4px; }

/* ---------- Error messages ---------- */

.err {
  display: none;
  font: 400 0.8125rem/1.3 var(--font-sans);
  color: var(--error);
}

.err--indented { padding-left: 29px; }

/* ---------- Password hint tooltip ---------- */

.pw-field { position: relative; }

.pw-hint { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; }

.pw-hint-icon {
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-2);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 500 0.6875rem/1 var(--font-sans);
  color: var(--text-2);
  cursor: default;
  transition: border-color 0.2s, color 0.2s;
}

.pw-hint:hover .pw-hint-icon { border-color: var(--text); color: var(--text); }

.pw-hint-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pw-hint:hover .pw-hint-tooltip { opacity: 1; }

.pw-hint-title {
  margin-bottom: 10px;
  font: 500 0.75rem/1.2 var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.pw-hint-tooltip ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }

.pw-hint-tooltip li {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 0.8125rem/1.3 var(--font-sans);
  color: var(--text-2);
}

.pw-hint-tooltip li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}

/* ---------- Success section ---------- */

.success-section { text-align: center; }


.site-shell .success-lead {
  margin: 0 auto 28px;
  max-width: 34ch;
  font: 400 1rem/1.5 var(--font-sans);
  color: var(--text-2);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .auth-split { flex-direction: column; }

  .auth-visual {
    flex: none;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px clamp(20px, 4vw, 56px);
  }

  .auth-visual__copy,
  .auth-visual__tags { display: none; }

  .auth-form-panel {
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: clamp(32px, 6vw, 56px) clamp(20px, 4vw, 56px);
  }
}

@media (max-width: 560px) {
  .site-shell .auth-heading { font-size: 1.625rem; }
  .field-row { flex-direction: column; }
}

/* Language switch (the auth page has its own layout without the site header) */
.auth-form-panel { position: relative; }
.auth-lang {
  position: absolute;
  top: 20px;
  right: clamp(20px, 4vw, 40px);
  display: inline-flex;
  gap: 6px;
  padding: 6px 10px;
  background: none;
  border: 0;
  color: var(--taupe-2);
  font: 500 13px/1 'Inconsolata', monospace;
  letter-spacing: .08em;
  cursor: pointer;
}
.auth-lang__opt.is-active { color: var(--heading); font-weight: 600; }
.auth-lang:hover .auth-lang__opt:not(.is-active) { color: var(--heading); }

.auth-lang a.auth-lang__opt { color: inherit; text-decoration: none; }
