/* ==========================================================================
   Shop login — single centered column.
   Loaded only by resources/views/shop/auth.blade.php, after shop-auth.css.
   The "Shared auth components" section re-skins the signup / forgot / 2FA
   partials that render in the same column so they match the light theme.
   ========================================================================== */

:root {
  --sl-bg: #FAFAF9;
  --sl-surface: #FFFFFF;
  --sl-surface-2: #F5F5F4;
  --sl-border: #E7E5E4;
  --sl-border-input: #D6D3D1;
  --sl-border-hover: #A8A29E;
  --sl-text: #1C1917;
  --sl-text-2: #44403C;
  --sl-muted: #78716C;
  --sl-subtle: #A8A29E;
  --sl-green: #16A34A;
  --sl-green-hover: #15803D;
  --sl-green-active: #166534;
  --sl-link: #15803D;
  --sl-focus: rgba(22, 163, 74, .16);
  --sl-error: #DC2626;
  --sl-radius: 8px;
  --sl-control-h: 44px;
  --sl-shadow-xs: 0 1px 2px rgba(28, 25, 23, .05);

  /* Re-point shop-auth.css variables to the light theme */
  --text: #1C1917;
  --text-muted: #78716C;
  --input-bg: #FFFFFF;
  --border: #E7E5E4;
  --error-bg: #FEF2F2;
}

html { background: var(--sl-bg) !important; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--sl-bg);
  color: var(--sl-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Replaced on this page: the layout's animated background and pulsing WhatsApp
   bubble (help is linked from the footer instead). */
.auth-bg,
.auth-whatsapp-float { display: none !important; }

/* ── Page ── */
.sl-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Bottom padding outweighs top so the column sits slightly above center. */
.sl-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 12vh;
}

.sl-form-wrap,
.sl-form-wrap.auth-card-body {
  width: 100%;
  max-width: 400px;
  padding: 0;
}

/* ── Logo ── */
.sl-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  color: var(--sl-text);
  text-decoration: none;
}
.sl-logo:hover { color: var(--sl-text); }
.sl-logo img { display: block; height: 26px; width: auto; }
.sl-logo span { font-size: 15px; font-weight: 600; letter-spacing: -.011em; }

/* ── Heading ── */
.sl-heading {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.024em;
  color: var(--sl-text);
}

.sl-subheading {
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  color: var(--sl-muted);
}

.sl-remembered {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -16px 0 28px;
  font-size: 13px;
  color: var(--sl-muted);
}
.sl-remembered i { font-size: 13px; color: var(--sl-subtle); }
.sl-remembered span {
  min-width: 0;
  font-weight: 500;
  color: var(--sl-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Fields ── */
.sl-field { margin-bottom: 20px; }

.sl-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.003em;
  color: var(--sl-text-2);
}

.sl-input-wrap { position: relative; }

#page-login .sl-input {
  height: var(--sl-control-h);
  padding: 0 13px;
  border: 1px solid var(--sl-border-input);
  border-radius: var(--sl-radius);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-xs);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -.006em;
  color: var(--sl-text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
#page-login .sl-input::placeholder { color: var(--sl-subtle); font-weight: 400; }
#page-login .sl-input:hover { border-color: var(--sl-border-hover); }
#page-login .sl-input:focus {
  border-color: var(--sl-green);
  background: var(--sl-surface);
  box-shadow: 0 0 0 3px var(--sl-focus);
}
#page-login .sl-input.error { border-color: var(--sl-error) !important; background: var(--sl-surface) !important; }
#page-login .sl-input.error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .14) !important; }
#page-login .sl-input.success { border-color: var(--sl-border-input) !important; }
#page-login .sl-input.success:focus { border-color: var(--sl-green) !important; }
#page-login .sl-input--pass { padding-right: 46px; }

#page-login .sl-input:-webkit-autofill {
  -webkit-text-fill-color: var(--sl-text);
  -webkit-box-shadow: 0 0 0 1000px var(--sl-surface) inset, var(--sl-shadow-xs);
}

.sl-pass-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sl-subtle);
  font-size: 16px;
  cursor: pointer;
  transition: color .12s ease;
}
.sl-pass-toggle:hover { color: var(--sl-text-2); }

#page-login .error-msg {
  margin: 7px 0 0;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--sl-error);
}
#page-login .error-msg i { font-size: 12px; }
#page-login .sl-recaptcha-error { justify-content: center; margin: 0 0 12px; }
#page-login .recaptcha-support-link { margin: 0 0 16px; }

/* ── Remember / forgot row ── */
.sl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 24px;
}

.sl-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: var(--sl-text-2);
  cursor: pointer;
  user-select: none;
}
.sl-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--sl-green);
  cursor: pointer;
}

.sl-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--sl-link);
  cursor: pointer;
}
.sl-link:hover { color: var(--sl-green-active); text-decoration: underline; text-underline-offset: 3px; }

/* ── Buttons ── */
#page-login .sl-btn-primary {
  height: var(--sl-control-h);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
}

.sl-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
  font-size: 13px;
  color: var(--sl-subtle);
}
.sl-divider::before,
.sl-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sl-border);
}

.sl-social { display: grid; gap: 10px; }

.sl-btn-social {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--sl-control-h);
  padding: 0 16px;
  border: 1px solid var(--sl-border-input);
  border-radius: var(--sl-radius);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-xs);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.006em;
  color: var(--sl-text);
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease;
}
.sl-btn-social:hover { color: var(--sl-text); background: #FAFAF9; border-color: var(--sl-border-hover); }
.sl-btn-social:active { background: var(--sl-surface-2); }
.sl-btn-social svg { flex-shrink: 0; }

.sl-switch {
  margin: 32px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--sl-muted);
}
.sl-switch a {
  margin-left: 2px;
  font-weight: 500;
  color: var(--sl-link);
  text-decoration: none;
}
.sl-switch a:hover { color: var(--sl-green-active); text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ── */
.sl-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 20px 24px 28px;
  font-size: 13px;
  color: var(--sl-subtle);
}
.sl-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.sl-footer a { color: var(--sl-muted); text-decoration: none; }
.sl-footer a:hover { color: var(--sl-text); }

.sl-recaptcha-note {
  flex-basis: 100%;
  margin: 2px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--sl-subtle);
}
.sl-recaptcha-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Attribution is shown in the footer instead (permitted by reCAPTCHA's FAQ). */
.grecaptcha-badge { visibility: hidden !important; }

/* Keyboard focus */
.sl-page a:focus-visible,
.sl-page button:focus-visible,
.sl-check input:focus-visible {
  outline: 2px solid var(--sl-green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Shared auth components (signup / forgot / 2FA / success) on the light theme ── */
.sl-form-wrap .card-title { color: var(--sl-text); font-weight: 600; letter-spacing: -.02em; }
.sl-form-wrap .card-subtitle { color: var(--sl-muted); }
.sl-form-wrap .form-label-custom { color: var(--sl-text-2); font-weight: 500; }

.sl-form-wrap .input-custom {
  border: 1px solid var(--sl-border-input);
  border-radius: var(--sl-radius);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-xs);
  font-weight: 400;
  color: var(--sl-text);
}
.sl-form-wrap .input-custom::placeholder { color: var(--sl-subtle); }
.sl-form-wrap .input-custom:focus {
  border-color: var(--sl-green);
  background: var(--sl-surface);
  box-shadow: 0 0 0 3px var(--sl-focus);
}
.sl-form-wrap .input-icon { color: var(--sl-subtle); }
.sl-form-wrap .toggle-pass { color: var(--sl-subtle); }
.sl-form-wrap .toggle-pass:hover { color: var(--sl-text-2); }
.sl-form-wrap .error-msg { color: var(--sl-error); font-weight: 500; }

.sl-form-wrap .btn-auth {
  border: 1px solid var(--sl-green-hover);
  border-radius: var(--sl-radius);
  background: var(--sl-green);
  font-weight: 500;
  letter-spacing: -.006em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(22, 101, 52, .24);
  transition: background-color .12s ease;
}
.sl-form-wrap .btn-auth::before { display: none; }
.sl-form-wrap .btn-auth:hover:not(:disabled) { background: var(--sl-green-hover); }
.sl-form-wrap .btn-auth:active:not(:disabled) { transform: none; background: var(--sl-green-active); }
.sl-form-wrap .btn-auth:disabled { opacity: .7; }
/* "Back" buttons in the signup partial carry a dark-theme inline background */
.sl-form-wrap .btn-auth[style*="255,255,255"] {
  background: var(--sl-surface) !important;
  border: 1px solid var(--sl-border-input) !important;
  box-shadow: var(--sl-shadow-xs) !important;
  color: var(--sl-text);
}
.sl-form-wrap .btn-auth[style*="255,255,255"]:hover { background: #FAFAF9 !important; border-color: var(--sl-border-hover) !important; }

.sl-form-wrap .divider hr { border-color: var(--sl-border); opacity: 1; }
.sl-form-wrap .divider span { color: var(--sl-subtle); font-weight: 500; }

.sl-form-wrap .btn-social {
  border: 1px solid var(--sl-border-input);
  border-radius: var(--sl-radius);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-xs);
  font-weight: 500;
  color: var(--sl-text);
}
.sl-form-wrap .btn-social:hover { background: #FAFAF9; border-color: var(--sl-border-hover); transform: none; }

.sl-form-wrap .auth-bottom { color: var(--sl-muted); font-weight: 400; }
.sl-form-wrap .auth-bottom a,
.sl-form-wrap .forgot-link,
.sl-form-wrap .email-exists-actions a,
.sl-form-wrap .terms-text a,
.sl-form-wrap .resend-btn,
.sl-form-wrap .resend-timer { color: var(--sl-link); font-weight: 500; }
.sl-form-wrap .terms-text { color: var(--sl-muted); }
.sl-form-wrap .resend-wrap { color: var(--sl-muted); font-weight: 400; }
.sl-form-wrap .resend-btn:disabled { color: var(--sl-subtle); }

.sl-form-wrap .otp-input {
  border: 1px solid var(--sl-border-input);
  border-radius: var(--sl-radius);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-xs);
  font-weight: 600;
  color: var(--sl-text);
}
.sl-form-wrap .otp-input:focus { border-color: var(--sl-green); background: var(--sl-surface); box-shadow: 0 0 0 3px var(--sl-focus); }
.sl-form-wrap .otp-input.filled { border-color: #86EFAC; background: #F0FDF4; }

.sl-form-wrap .step-circle { border-color: var(--sl-border); color: var(--sl-subtle); }
.sl-form-wrap .step-circle.active { border-color: var(--sl-green); color: var(--sl-link); background: #F0FDF4; }
.sl-form-wrap .step-circle.done { border-color: var(--sl-green); background: var(--sl-green); color: #fff; }
.sl-form-wrap .step-line { background: var(--sl-border); }
.sl-form-wrap .step-line.done { background: var(--sl-green); }

.sl-form-wrap .strength-track { background: var(--sl-border); }
.sl-form-wrap .receipt-preview-note { background: #F0FDF4; border-color: #BBF7D0; }
.sl-form-wrap .receipt-preview-note i { color: var(--sl-link); }

.sl-form-wrap .biztype-card { border: 1px solid var(--sl-border); border-radius: 10px; background: var(--sl-surface); }
.sl-form-wrap .biztype-card:hover { border-color: var(--sl-border-input); background: #FAFAF9; transform: none; }
.sl-form-wrap .biztype-card.selected { border-color: var(--sl-green); background: #F0FDF4; box-shadow: 0 0 0 3px var(--sl-focus); }
.sl-form-wrap .biztype-icon { box-shadow: none; }
.sl-form-wrap .biztype-name { font-weight: 600; }
.sl-form-wrap .biztype-check { border-color: var(--sl-border-input); }
.sl-form-wrap .biztype-subtypes { background: #FAFAF9; border-color: var(--sl-border); }
.sl-form-wrap .subtype-chip { border: 1px solid var(--sl-border-input); color: var(--sl-text-2); background: var(--sl-surface); font-weight: 500; }
.sl-form-wrap .subtype-chip:hover { border-color: var(--sl-border-hover); }
.sl-form-wrap .subtype-chip.active { border-color: var(--sl-green); background: #F0FDF4; color: var(--sl-link); }

.sl-form-wrap .two-factor-options { background: #FAFAF9; border: 1px solid var(--sl-border); }
.sl-form-wrap .two-factor-options .form-check-custom:hover { background: var(--sl-surface-2); }
.sl-form-wrap .method-label { font-weight: 600; }

.sl-form-wrap .phone-input-row { border: 1px solid var(--sl-border-input); border-radius: var(--sl-radius); background: var(--sl-surface); box-shadow: var(--sl-shadow-xs); }
.sl-form-wrap .phone-input-row:focus-within { border-color: var(--sl-green); background: var(--sl-surface); box-shadow: 0 0 0 3px var(--sl-focus); }
.sl-form-wrap .phone-country-btn { border-right: 1px solid var(--sl-border); color: var(--sl-text); }
.sl-form-wrap .phone-country-btn:hover { background: #FAFAF9; }
.sl-form-wrap .phone-dial-code { font-weight: 600; }
.sl-form-wrap .phone-chevron,
.sl-form-wrap .phone-search-icon { color: var(--sl-subtle); }
.sl-form-wrap .phone-dropdown {
  background: var(--sl-surface);
  border: 1px solid var(--sl-border);
  box-shadow: 0 12px 32px rgba(28, 25, 23, .10);
}
.sl-form-wrap .phone-dropdown-search { border-bottom-color: var(--sl-border); }
.sl-form-wrap .phone-search-input { background: #FAFAF9; border: 1px solid var(--sl-border); color: var(--sl-text); }
.sl-form-wrap .phone-search-input::placeholder { color: var(--sl-subtle); }
.sl-form-wrap .phone-dropdown-list::-webkit-scrollbar-thumb { background: var(--sl-border-input); }
.sl-form-wrap .phone-code-option:hover,
.sl-form-wrap .phone-code-option-shop:hover,
.sl-form-wrap .phone-code-option.highlighted,
.sl-form-wrap .phone-code-option-shop.highlighted { background: var(--sl-surface-2); }
.sl-form-wrap .opt-name { color: var(--sl-text-2); }

/* Success page redirect bar track/caption use dark-theme inline styles */
#page-success [style*="rgba(255,255,255,.1)"] { background: var(--sl-border) !important; }
#page-success [style*="color:#555"] { color: var(--sl-muted) !important; }
.sl-form-wrap .success-icon { background: #DCFCE7; animation: none; }

.toast-custom {
  background: var(--sl-surface);
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius);
  box-shadow: 0 8px 24px rgba(28, 25, 23, .10);
}
.toast-text { font-weight: 500; }

/* No page-switch motion on this page */
.sl-form-wrap .auth-page { animation: none; }

/* ── Post-login transition ── */
/* The page carries its own centred mark, so the column logo and footer step aside. */
.sl-page.is-redirecting .sl-logo,
.sl-page.is-redirecting .sl-footer { display: none; }
.sl-page.is-redirecting .sl-main { justify-content: center; }

.sl-redirect.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: sl-redirect-in .24s ease-out both;
}

.sl-redirect-mark {
  display: block;
  height: 32px;
  width: auto;
  margin-bottom: 28px;
}

.sl-redirect-heading {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.019em;
  color: var(--sl-text);
}

.sl-redirect-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: -.006em;
  color: var(--sl-muted);
}

/* Indeterminate hairline: a short green segment glides across a quiet track. */
.sl-redirect-track {
  position: relative;
  width: 112px;
  height: 2px;
  margin-top: 28px;
  border-radius: 2px;
  background: var(--sl-border);
  overflow: hidden;
}
.sl-redirect-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: var(--sl-green);
  animation: sl-redirect-glide 1.4s cubic-bezier(.65, 0, .35, 1) infinite;
}

.sl-redirect-slow {
  margin: 24px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sl-muted);
}
.sl-redirect-slow a {
  margin-left: 2px;
  font-weight: 500;
  color: var(--sl-link);
  text-decoration: none;
}
.sl-redirect-slow a:hover { color: var(--sl-green-active); text-decoration: underline; text-underline-offset: 3px; }

@keyframes sl-redirect-glide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}

@keyframes sl-redirect-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-redirect.active { animation: none; }
  .sl-redirect-track span {
    width: 100%;
    animation: sl-redirect-breathe 2s ease-in-out infinite alternate;
  }
  @keyframes sl-redirect-breathe {
    from { opacity: .35; }
    to   { opacity: 1; }
  }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .sl-main {
    justify-content: flex-start;
    padding: 48px 20px 40px;
  }
  .sl-logo { margin-bottom: 36px; }
  .sl-heading { font-size: 24px; }
  .sl-subheading { margin-bottom: 28px; }
  /* 16px inputs stop iOS Safari from zooming on focus */
  #page-login .sl-input { font-size: 16px; }
  :root { --sl-control-h: 46px; }
  .sl-footer { padding: 16px 20px 24px; }
}

@media (max-width: 360px) {
  .sl-main { padding-left: 16px; padding-right: 16px; }
  .sl-row { flex-wrap: wrap; row-gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-page *,
  .sl-page *::before,
  .sl-page *::after { transition: none !important; }
}
