/**
 * Auth — compact editorial cards, split brand panel (merchant + admin).
 */

.auth-body {
  min-height: 100vh;
  margin: 0;
  background: var(--lm-cream);
  font-family: var(--lm-font-body);
  color: var(--lm-ink);
}

.auth-body--admin {
  --auth-panel-bg: linear-gradient(145deg, #0c1222 0%, #1e3a5f 52%, #0f766e 100%);
  --auth-panel-ink: #f8fafc;
  --auth-panel-muted: rgba(248, 250, 252, 0.72);
  --auth-accent: #38bdf8;
  --auth-accent-deep: #0ea5e9;
}

.auth-body--merchant {
  --auth-panel-bg: linear-gradient(155deg, #0c1222 0%, #134e4a 48%, #0d9488 100%);
  --auth-panel-ink: #faf8f5;
  --auth-panel-muted: rgba(250, 248, 245, 0.78);
  --auth-accent: var(--lm-accent-bright);
  --auth-accent-deep: var(--lm-accent-deep);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .auth-shell {
    flex-direction: row;
  }
}

.auth-brand {
  display: none;
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--auth-panel-bg);
  color: var(--auth-panel-ink);
}

@media (min-width: 900px) {
  .auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(42%, 480px);
    flex-shrink: 0;
  }
}

.auth-brand__logo {
  font-family: var(--lm-font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.auth-brand__tagline {
  margin: 1.25rem 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 28ch;
  color: var(--auth-panel-muted);
  position: relative;
  z-index: 1;
}

.auth-brand__points {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.auth-brand__points li::before {
  content: '—';
  margin-right: 0.5rem;
  opacity: 0.5;
}

.auth-brand__points a {
  color: var(--auth-accent);
}

.auth-brand__glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  bottom: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.auth-shell__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auth-header--mobile {
  padding: 1rem 1.25rem;
  text-align: center;
}

@media (min-width: 900px) {
  .auth-header--mobile {
    display: none;
  }
}

.auth-header__logo {
  font-family: var(--lm-font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--lm-ink);
  text-decoration: none;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem var(--lm-space-container-x) 2rem;
}

@media (min-width: 900px) {
  .auth-main {
    padding: 2.5rem 2rem 3rem;
  }
}

.auth-shell__note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--lm-muted);
  padding: 0 1.25rem 1.25rem;
  margin: 0;
}

.auth-shell__note a {
  color: var(--lm-accent-deep);
}

.auth-page {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: auth-enter 0.55s var(--lm-ease-out) both;
}

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

@keyframes auth-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  background: var(--lm-paper);
  border: 1px solid var(--lm-border);
  border-radius: 14px;
  padding: 1.35rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-shadow: var(--lm-shadow-md);
}

@media (min-width: 768px) {
  .auth-card {
    padding: 1.5rem 1.65rem 1.65rem;
  }
}

.auth-card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
}

.auth-card__head--center {
  align-items: center;
  text-align: center;
}

.auth-card__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lm-accent-deep);
}

.auth-card__avatar-wrap {
  display: none;
}

.auth-card__title {
  font-family: var(--lm-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.auth-card__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--lm-muted);
  line-height: 1.45;
  max-width: 36ch;
}

.auth-card__head--center .auth-card__desc {
  max-width: none;
}

.auth-card__sep {
  height: 1px;
  background: var(--lm-border-soft);
  border: 0;
  margin: 0;
}

.auth-card__alert {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-card__alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-card__alert--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--lm-muted);
}

.auth-progress__label {
  color: var(--lm-ink-soft);
}

.auth-progress__track {
  display: flex;
  gap: 0.35rem;
}

.auth-progress__seg {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--lm-border);
  transition: background 0.2s var(--lm-ease-out);
}

.auth-progress__seg.is-active {
  background: var(--lm-accent);
}

.auth-progress__seg.is-done {
  background: var(--lm-accent-deep);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-form__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--lm-muted);
  line-height: 1.4;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field label {
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="tel"],
.auth-field .form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--lm-border);
  border-radius: 10px;
  font-size: 0.9375rem;
  background: var(--lm-paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--lm-accent);
  box-shadow: 0 0 0 3px var(--lm-accent-muted);
}

.auth-field--password {
  position: relative;
}

.auth-field--password input {
  padding-right: 2.5rem;
}

.auth-pw-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--lm-muted);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
}

.auth-pw-toggle:hover {
  color: var(--lm-ink);
}

.auth-pw-toggle:focus-visible {
  outline: 2px solid var(--lm-accent);
  outline-offset: 2px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  cursor: pointer;
  line-height: 1.4;
}

.auth-check input {
  margin-top: 0.15rem;
  accent-color: var(--lm-accent);
  flex-shrink: 0;
}

.auth-link {
  font-size: 0.8125rem;
  color: var(--lm-accent-deep);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.auth-actions--split {
  flex-direction: row;
  flex-wrap: wrap;
}

.auth-actions--split .auth-btn {
  flex: 1;
  min-width: 7rem;
}

.auth-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--btn-primary-bg, var(--lm-accent-deep, #0f766e));
  color: var(--btn-primary-fg, #fff);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.auth-btn:hover {
  background: var(--btn-primary-bg-hover, #115e59);
}

.auth-btn:active {
  transform: scale(0.99);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn--secondary {
  background: transparent;
  color: var(--btn-ghost-fg-hover, var(--lm-ink-soft));
  border: 1px solid var(--btn-ghost-border, var(--lm-border));
}

.auth-btn--secondary:hover {
  background: var(--btn-secondary-bg-hover, var(--lm-mist));
  color: var(--btn-ghost-fg-hover, var(--lm-ink));
}

.auth-body--admin .auth-btn {
  background: var(--auth-accent-deep);
}

.auth-body--admin .auth-btn:hover {
  background: #0284c7;
}

.auth-footer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--lm-muted);
}

.auth-footer a {
  color: var(--lm-accent-deep);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-otp-input {
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-card .lm-phone-field,
.auth-card .lm-select-field {
  margin: 0;
}

.auth-card .lm-select-field label,
.auth-card .lm-phone-field label {
  font-size: 0.8125rem;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .auth-grid-2 {
    grid-template-columns: 1fr;
  }
}

.auth-step-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--lm-muted);
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.auth-step-back:hover {
  color: var(--lm-accent-deep);
}
