/* =========================================================
   Barbwired sign-in / create account page
   Layout: full navy band like the home hero. Desktop: reasons
   to sign up on the left, the white account card on the right.
   Phone: a short heading, then the card.
   Uses the tokens and form styles defined in styles.css.
   ========================================================= */

.page-auth .site-footer { background: var(--bg); }

.auth {
  margin-top: calc(var(--header-total) * -1);
  padding-top: calc(var(--header-total) + clamp(32px, 6vw, 72px));
  padding-bottom: clamp(48px, 8vw, 96px);
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(180deg, var(--night) 0%, #0b0f1e 40%, #10152a 75%, var(--hero-end) 100%);
  color: var(--on-dark);
}

.auth__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(32px, 7vw, 112px);
  align-items: start;
}
@media (min-width: 900px) {
  .auth__intro { padding-top: 104px; }   /* stays put when the card grows */
}

/* ---------- Left: reasons to sign up ---------- */
.auth__intro { display: grid; gap: 18px; max-width: 500px; min-width: 0; }
.auth__intro .eyebrow { color: var(--on-dark-2); }
.auth__intro h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
  padding-bottom: .12em;
  margin-bottom: -.12em;
  background: linear-gradient(180deg, #ffffff 30%, var(--silver) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth__perks { display: grid; gap: 20px; margin-top: 14px; }
.auth__perks li { display: flex; align-items: flex-start; gap: 14px; }
.auth__perks li > span:last-child { color: var(--on-dark-2); font-size: 0.9375rem; line-height: 1.5; }
.auth__perks b { display: block; color: var(--on-dark); font-weight: 600; font-size: 1rem; }
.auth__perk-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--on-dark-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--on-dark);
}
.auth__perk-icon svg { width: 22px; height: 22px; }

/* ---------- Right: the card ---------- */
.auth__card {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 28px;
  border: 1px solid var(--panel-ring);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .7);
}
.auth__mark { width: 52px; height: 52px; }
.auth__view { display: grid; gap: 16px; }
.auth__view h2 { font-size: 1.625rem; letter-spacing: -0.035em; }
.auth__sub { margin-top: -6px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; }
.auth__stack { display: grid; gap: 10px; }

/* Sign in / Create account switch */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--mist);
}
.tabs__btn {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 0.9375rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.tabs__btn:hover { color: var(--ink); }
.tabs__btn[aria-selected="true"] {
  background: var(--tab-on);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(11, 14, 26, .08), 0 6px 16px -6px rgba(11, 14, 26, .18);
}

.auth__or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.auth__or::before,
.auth__or::after { content: ""; height: 1px; background: var(--line); }

/* Why you're here (e.g. tried to book while signed out) */
.auth__note {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
}
.auth__note .link { color: inherit; }

/* Messages above the form */
.auth__msg {
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}
.auth__msg--info { background: var(--info-bg); color: var(--info); }
.auth__msg--ok { background: var(--ok-bg); color: var(--ok-text); }
.auth__msg .link { color: inherit; }

/* Forms */
.auth__form { display: grid; gap: 16px; }
.auth__form .btn--dark { margin-top: 2px; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__hint { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.4; }

.field__rule { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.8125rem; transition: color .2s ease; }
.field__rule::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: background-color .2s ease;
}
.field__rule.is-met { color: var(--ok); }
.field__rule.is-met::before { background: currentColor; }

.pw { position: relative; }
.field .pw input { padding-right: 76px; }
.pw__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  height: 36px;
  padding: 0 12px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: 500 0.8125rem/1 var(--font-sans);
  cursor: pointer;
}
.pw__toggle:hover { background: var(--mist); color: var(--ink); }

.field__row .link { font-size: 0.875rem; }

.auth__legal { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.5; }
.auth__signout { justify-self: center; margin-top: 4px; font-size: 0.9375rem; }

/* Customer or barber */
.kind { margin: 0; padding: 0; border: 0; min-width: 0; }
.kind__legend { margin-bottom: 8px; padding: 0; font-size: 0.875rem; font-weight: 500; }
.kind__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind__opt { position: relative; cursor: pointer; }
.kind__opt span {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  line-height: 1.3;
  transition: border-color .15s ease, background-color .15s ease;
}
.kind__opt b { font-size: 0.9375rem; font-weight: 600; }
.kind__opt small { color: var(--ink-3); font-size: 0.8125rem; }
.kind__opt:hover span { border-color: var(--line-strong); }
.kind__opt input:checked + span { border-color: var(--fill); box-shadow: 0 0 0 1px var(--fill); }
.kind__opt input:focus-visible + span { outline: 2px solid var(--pole-blue); outline-offset: 2px; }

.auth__fields { display: grid; gap: 16px; }
.auth__switch--sub { margin-top: -8px; font-size: 0.875rem; color: var(--ink-3); }

/* Barber access code */
.barber-code { display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: var(--mist); }
.barber-code__note { color: var(--ink-2); font-size: 0.875rem; line-height: 1.5; }
.barber-code .field__hint a { color: var(--ink-2); }
.field .code-input {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field .code-input::placeholder { letter-spacing: 0.08em; }
.code-ok {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ok-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}
.code-ok::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cpath d='M4.8 8.2l2.1 2.1 4.3-4.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cpath d='M4.8 8.2l2.1 2.1 4.3-4.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.demo__note .link { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* Demo accounts (stand-in only) */
.demo { display: grid; gap: 8px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 16px; }
.demo__title { font-size: 0.875rem; font-weight: 600; }
.demo__note { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.45; }
.demo__list { display: grid; gap: 6px; }
.demo__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 500 0.875rem/1.3 var(--font-sans);
  text-align: left;
  cursor: pointer;
}
.demo__btn:hover { border-color: var(--line-strong); }
.demo__btn small { color: var(--ink-3); font-size: 0.8125rem; font-weight: 400; }
.auth__legal a { color: var(--ink-2); }
.auth__switch { color: var(--ink-2); font-size: 0.9375rem; text-align: center; }

.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }

/* ---------- Phone ---------- */
@media (max-width: 899px) {
  .auth__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .auth__intro { max-width: none; gap: 10px; }
  .auth__intro h1 { font-size: clamp(2.25rem, 9vw, 3rem); }
  .auth__perks { display: none; }
  .auth__card { max-width: 480px; width: 100%; justify-self: center; }
}

@media (max-width: 440px) {
  /* the menu already links to the barbers; keeps the header on one line */
  .page-auth .nav__actions .btn--sm { display: none; }
}

@media (max-width: 640px) {
  .auth__intro { text-align: left; }
  .auth__card { border-radius: 24px; }
}
