/**
 * LIBASIX Login / Create Account pages. Loaded only when a logged-out
 * visitor is on the My Account page (see inc/enqueue.php).
 */

/* Same page.php width trap already fixed for Checkout/Cart/Account. */
body.woocommerce-account .page-content__body { max-width: 1360px; margin-inline: auto; }

.auth-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1.5rem;
  font-size: var(--step-xs);
  color: var(--color-ink-faint);
}
.auth-breadcrumb a { color: var(--color-ink-soft); text-decoration: none; }
.auth-breadcrumb a:hover { color: var(--color-ink); }
.auth-breadcrumb svg { width: 12px; height: 12px; flex-shrink: 0; }
.auth-breadcrumb span { color: var(--color-ink); font-weight: 600; }

/* ---------------------------------------------------------------
 * Two-column layout
 * ------------------------------------------------------------- */
.auth-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 1024px) {
  .auth-page { flex-direction: row; align-items: stretch; }
  .auth-card { flex: 0 0 44%; }
  .auth-visual { flex: 1; min-width: 0; }
}

/* ---------------------------------------------------------------
 * Form card
 * ------------------------------------------------------------- */
.auth-card {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 18px;
  padding: 2rem;
  animation: auth-fade-in 250ms ease;
}
.auth-card__heading { font-size: var(--step-2xl); margin: 0 0 0.4rem; }
.auth-card__subtitle { font-size: var(--step-base); font-weight: 600; margin: 0 0 0.3rem; }
.auth-card__text { color: var(--color-ink-soft); font-size: var(--step-sm); margin: 0 0 1.75rem; }

.auth-form .auth-field { margin-bottom: 1.1rem; }
/* WooCommerce core's own stylesheet (.woocommerce form .form-row-first,
   specificity 0,2,1 — a class, an element, a class) floats these at
   every width unconditionally, beating a plain two-class override here
   — reset explicitly with !important rather than just omitting a rule,
   otherwise core's float wins below the 480px breakpoint and the two
   fields stay side by side instead of stacking. */
.auth-form .form-row-first,
.auth-form .form-row-last { float: none !important; width: 100% !important; margin-bottom: 1.1rem; }
@media (min-width: 480px) {
  .auth-form .form-row-first { float: left !important; width: calc(50% - 0.5rem) !important; }
  .auth-form .form-row-last { float: right !important; width: calc(50% - 0.5rem) !important; }
}
.auth-form label { display: block; margin-bottom: 0.4rem; font-size: var(--step-xs); font-weight: 600; color: var(--color-ink-soft); }
.auth-form .required { color: #b3261e; }

.auth-field__wrap { position: relative; display: flex; align-items: center; }
.auth-field__icon {
  position: absolute;
  left: 0.9rem;
  display: flex;
  align-items: center;
  color: var(--color-ink-faint);
  pointer-events: none;
}
.auth-field__wrap .input-text,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  height: 50px;
  padding: 0 1rem 0 2.75rem;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-white);
  font-size: var(--step-sm);
  color: var(--color-ink);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.auth-field__wrap .input-text:focus,
.auth-form input:focus {
  outline: none;
  border-color: var(--color-ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}
/* WooCommerce core wraps password fields in its own <span class="password-input">
   and injects a native eye-toggle button — let that span fill the row
   like a plain input would, and hide the native toggle since our own
   .auth-field__toggle already provides a real, styled one. */
.auth-field__wrap .password-input { flex: 1; min-width: 0; position: relative; display: block; }
.auth-field__wrap .show-password-input { display: none !important; }
.auth-field__toggle {
  position: absolute;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--color-ink-faint);
  cursor: pointer;
  border-radius: 8px;
}
.auth-field__toggle:hover { color: var(--color-ink); background: var(--color-bg-alt); }
.auth-field__toggle-icon--hide { display: none; }
.auth-field__toggle.is-visible .auth-field__toggle-icon--show { display: none; }
.auth-field__toggle.is-visible .auth-field__toggle-icon--hide { display: flex; }
.auth-field__hint { margin: 0.5rem 0 0; font-size: 11px; color: var(--color-ink-faint); }

.auth-form__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.25rem 0 1.5rem; flex-wrap: wrap; }
.auth-checkbox { display: flex; align-items: center; gap: 0.5em; font-size: var(--step-xs); color: var(--color-ink-soft); cursor: pointer; }
.auth-checkbox input { width: 16px; height: 16px; accent-color: var(--color-ink); }
.auth-form__lost { font-size: var(--step-xs); font-weight: 600; color: var(--color-ink); text-decoration: underline; }
.auth-form__lost:hover { color: var(--color-forest); }

.libasix-auth-terms { margin-top: 0.25rem; margin-bottom: 1.5rem; }
.libasix-auth-terms label { display: flex; align-items: flex-start; gap: 0.55em; font-weight: 400; font-size: var(--step-xs); color: var(--color-ink-soft); cursor: pointer; }
.libasix-auth-terms input { width: 16px; height: 16px; margin-top: 0.15em; flex-shrink: 0; accent-color: var(--color-ink); }
.libasix-auth-terms a { color: var(--color-ink); text-decoration: underline; }

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  height: 54px;
  background: var(--color-ink);
  color: var(--color-white);
  border: none;
  border-radius: 10px;
  font-size: var(--step-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--speed) ease, transform var(--speed) ease;
}
.auth-submit:hover { background: var(--color-forest); transform: translateY(-1px); }

.auth-social { margin-top: 1.5rem; }
.auth-social__divider { position: relative; text-align: center; margin: 0 0 1.1rem; }
.auth-social__divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--color-line); }
.auth-social__divider span { position: relative; padding: 0 0.8rem; background: var(--color-white); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-faint); }
.auth-social__buttons { display: flex; flex-direction: column; gap: 0.7rem; }
@media (min-width: 480px) { .auth-social__buttons { flex-direction: row; } }
.auth-social__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  color: var(--color-ink);
  font-size: var(--step-xs);
  font-weight: 600;
  text-decoration: none;
}
.auth-social__btn:hover { border-color: var(--color-ink); }
.auth-social__btn img { width: 18px; height: 18px; }

.auth-switch { margin: 1.5rem 0 0; text-align: center; font-size: var(--step-sm); color: var(--color-ink-soft); }
.auth-switch a { display: inline-flex; align-items: center; gap: 0.3em; margin-left: 0.35em; font-weight: 700; color: var(--color-ink); text-decoration: none; }
.auth-switch a:hover { color: var(--color-forest); }
.auth-switch svg { width: 13px; height: 13px; }

/* WooCommerce notices inside the card */
.auth-card .woocommerce-error,
.auth-card .woocommerce-message,
.auth-card .woocommerce-info {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0.85em 1em;
  border-radius: 10px;
  font-size: var(--step-xs);
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-ink);
}
.auth-card .woocommerce-error { border-left-color: #b3261e; color: #7a1d17; background: rgba(179, 38, 30, 0.06); }
.auth-card .woocommerce-error li { list-style: none; }
.auth-card .woocommerce-message { border-left-color: var(--color-forest); background: rgba(31, 51, 39, 0.06); }

/* ---------------------------------------------------------------
 * Editorial visual panel
 * ------------------------------------------------------------- */
.auth-visual {
  position: relative;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  color: var(--color-white);
  background: var(--color-ink);
  animation: auth-fade-in 350ms ease;
}
@media (min-width: 1024px) { .auth-visual { min-height: 560px; } }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual__overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: inherit;
  padding: 1.75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 30%, rgba(0, 0, 0, 0.35) 65%, rgba(0, 0, 0, 0.85) 100%);
}
.auth-visual__brand { display: flex; flex-direction: column; }
.auth-visual__logo { font-family: var(--font-heading); font-size: var(--step-lg); font-weight: 700; letter-spacing: 0.02em; }
.auth-visual__tagline { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.8; }

.auth-visual__message { margin: auto 0 1.5rem; }
.auth-visual__message h2 { font-family: var(--font-heading); font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.1; margin: 0 0 0.6rem; max-width: 12ch; }
.auth-visual__eyebrow { font-size: var(--step-xs); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin: 0 0 0.75rem; }
.auth-visual__quote { font-family: var(--font-heading); font-style: italic; font-size: var(--step-base); opacity: 0.9; margin: 0; }

.auth-visual__benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.auth-visual__benefit { display: flex; flex-direction: column; gap: 0.5rem; font-size: 11px; line-height: 1.4; }
.auth-visual__benefit svg { width: 20px; height: 20px; opacity: 0.9; }
.auth-visual__benefit strong { display: block; font-size: var(--step-xs); margin-bottom: 0.1em; }

/* ---------------------------------------------------------------
 * Shared benefit strip
 * ------------------------------------------------------------- */
.auth-benefits { border: 1px solid var(--color-line); border-radius: 14px; padding: 1.25rem; margin-bottom: 2rem; }
@media (min-width: 780px) { .auth-benefits { grid-template-columns: repeat(4, 1fr); } }

@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-visual { animation: none; }
}
