/* ==========================================================================
   StoreHub — Sign In / Register
   Sliding sign-in/register toggle page and the searchable country/city
   combobox layout. Form fields and buttons: components.css.
   ========================================================================== */

/* ---------------------------------- */
/* Shared form styles                 */
/* ---------------------------------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-footer-note { text-align: center; font-size: 14px; color: var(--color-text-secondary); margin-top: 22px; }
.form-footer-note a { color: var(--color-primary-light); font-weight: 600; }

/* ---------------------------------- */
/* Searchable select (combobox)       */
/* ---------------------------------- */

/* ---------------------------------- */
/* Sliding sign-in / register         */
/* ---------------------------------- */
.auth-toggle-logo {
  position: absolute;
  top: 32px;
  left: 40px;
  z-index: 10;
}

.auth-toggle-container {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The top padding keeps the card below the logo and the language flag
     (both pinned to the top corners), whatever the window's height. */
  padding: 92px var(--gutter) 32px;
}

.auth-toggle-stage {
  position: relative;
  width: 100%;
  max-width: 1240px;
  height: 700px;
  max-height: calc(100vh - 124px);
  min-height: 520px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.auth-toggle-form-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 40px) var(--pad-panel);
  background: transparent;
  overflow-y: auto;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease), visibility 0.7s;
}

.auth-toggle-form-inner { width: 100%; max-width: 400px; margin: auto; }
.auth-toggle-form-inner h1 { font-size: var(--fs-panel-title); margin: 0 0 6px; }

/* Cover banner above the sign-in and register forms (macro auth_cover in
   www/signin.html). Art on the right, text on the calm left side. */
.auth-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: clamp(150px, 34vw, 176px);
  padding: clamp(16px, 4vw, 22px);
  padding-right: 46%;
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #FFFFFF;
  background: var(--brand-navy) url("/assets/storehub/images/auth/cover.svg") right center / cover no-repeat;
  box-shadow: var(--shadow-navy);
}
/* Keeps the text readable over a custom (photo) cover too */
.auth-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 44, 61, 0.92) 0%, rgba(11, 44, 61, 0.6) 48%, rgba(11, 44, 61, 0) 75%);
}
.auth-cover > * { position: relative; }
.auth-cover-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; margin-bottom: auto; background: #FFFFFF; }
.auth-cover-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #F4BE96; white-space: nowrap; }
/* On desktop the cover page (overlay) replaces the banner in the form */
@media (min-width: 901px) {
  .auth-toggle-form-inner .auth-cover { display: none; }
}
.auth-toggle-form-inner .auth-cover-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.2vw + 14px, 22px);
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
  margin: 0;
  text-wrap: balance;
}
.auth-toggle-form-inner .auth-cover-sub { font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.78); margin: 2px 0 0; }
.auth-toggle-form-inner > p:first-of-type,
.auth-toggle-form-inner form > p:first-child { color: var(--color-text-secondary); font-size: 14.5px; margin-bottom: 26px; }

.auth-toggle-register-panel { padding-left: 48px; padding-right: 48px; }
.auth-toggle-register-panel .auth-toggle-form-inner { max-width: 480px; }
.auth-toggle-register-panel .form-group { margin-bottom: 14px; }
.auth-toggle-register-panel .form-row { gap: 16px; }
.auth-toggle-register-panel .auth-toggle-form-inner > p:first-of-type { margin-bottom: 20px; }

.auth-toggle-form-panel #signin-form button[type="submit"],
.auth-toggle-form-panel #register-form button[type="submit"] { margin-top: 12px; }

.auth-toggle-signin-panel {
  left: 0;
  z-index: 2;
}

.auth-toggle-register-panel {
  left: 50%;
  z-index: 1;
}

.auth-toggle-overlay-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 5;
  transition: transform 0.7s var(--ease);
}

.auth-toggle-overlay {
  position: relative;
  width: 200%;
  height: 100%;
  left: -100%;
  background: var(--gradient-hero-bg), var(--gradient-card);
  border-left: 1px solid var(--color-border);
  transition: transform 0.7s var(--ease);
  display: flex;
}

.auth-toggle-overlay-panel {
  width: 50%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--pad-panel);
  box-sizing: border-box;
}

/* Desktop: each overlay half is a cover page. Navy at the top for the text, the
   cover art along the bottom (same art as the phone banner, .auth-cover). */
.auth-toggle-overlay-panel {
  justify-content: flex-start;
  padding-top: clamp(56px, 9vh, 84px);
  background:
    linear-gradient(to bottom, var(--brand-navy) 0%, var(--brand-navy) 56%, rgba(11, 44, 61, 0) 84%),
    url("/assets/storehub/images/auth/cover.svg") right bottom / 118% auto no-repeat,
    var(--brand-navy);
}
.auth-toggle-overlay-panel .auth-cover-eyebrow { margin-bottom: 12px; }
/* With a Home page logo (StoreVela Settings): no drawing, just the logo on
   a black card, tilted towards the text, lit from above, floating on a soft
   red glow. Same look as the home page (shop.css .shop-logo-card). */
.auth-logo-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 14%;
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 38%),
    radial-gradient(120% 100% at 30% 0%, #2a2a2e, #0b0b0d 70%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 12px 24px -12px rgba(0, 0, 0, 0.5);
  transform: rotateY(-14deg) rotateX(6deg);
  animation: auth-logo-float 6s ease-in-out infinite;
}
.auth-logo-card img { width: 100%; height: auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
@keyframes auth-logo-float {
  0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(-10deg) rotateX(4deg) translateY(-10px); }
}
.auth-logo-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #E1261C 45%, transparent), transparent 65%);
  filter: blur(26px);
  opacity: 0.7;
  pointer-events: none;
}

/* Desktop cover page: the logo above the text, on plain navy */
.auth-toggle-overlay-panel.has-logo {
  justify-content: center;
  padding-top: var(--pad-panel);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand-warm) 14%, transparent), transparent 55%),
    radial-gradient(80% 70% at 100% 100%, color-mix(in srgb, #3b6f88 35%, transparent), transparent 60%),
    var(--brand-navy);
}
.auth-panel-logo {
  position: relative;
  width: clamp(170px, 16vw, 220px);
  margin-bottom: 34px;
  perspective: 1200px;
}
.auth-panel-logo .auth-logo-card { position: relative; border-radius: 26px; }

/* Phone banner: the text on the left, the logo card on the right */
.auth-cover.has-logo {
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand-warm) 14%, transparent), transparent 55%), var(--brand-navy);
  padding-right: calc(clamp(16px, 4vw, 22px) + 108px);
}
.auth-cover.has-logo::before { display: none; }
.auth-cover-badge {
  position: absolute;
  top: 50%;
  right: clamp(16px, 4vw, 22px);
  width: 96px;
  margin-top: -48px;
  perspective: 800px;
}
.auth-cover-badge .auth-logo-card { position: relative; border-radius: 16px; padding: 12%; }
.auth-cover-badge .auth-logo-glow { filter: blur(16px); }
@media (prefers-reduced-motion: reduce) {
  .auth-logo-card { animation: none; }
}
/* Top right of the sign-in page: "Back to home" beside the language flag */
.auth-top-actions { display: flex; align-items: center; gap: 10px; }
.auth-label-short { display: none; }
@media (max-width: 480px) {
  .auth-label-long { display: none; }
  .auth-label-short { display: inline; }
}
.auth-toggle-overlay-panel h2 { color: #FFFFFF; font-size: var(--fs-panel-title); line-height: 1.2; margin-bottom: 14px; max-width: 380px; text-wrap: balance; }
.auth-toggle-overlay-panel p { color: rgba(255, 255, 255, 0.78); font-size: 15px; margin-bottom: 26px; max-width: 340px; }

/* State: register active — overlay slides left, register form reveals on the right */
.auth-toggle-stage.is-register .auth-toggle-signin-panel {
  transform: translateX(-40px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-toggle-stage.is-register .auth-toggle-register-panel {
  transform: translateX(0);
}
.auth-toggle-stage:not(.is-register) .auth-toggle-register-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-toggle-stage.is-register .auth-toggle-overlay-wrap { transform: translateX(-100%); }
.auth-toggle-stage.is-register .auth-toggle-overlay { transform: translateX(50%); }

.auth-toggle-mobile-link { display: none; }

/* Desktop: the card grows to fit the form that is showing, so the long
   register form is never cut off (the page scrolls instead). The showing
   panel is in the flow and sets the height; the other stays on top of it. */
@media (min-width: 901px) {
  .auth-toggle-stage { height: auto; max-height: none; min-height: min(700px, calc(100vh - 124px)); }
  .auth-toggle-stage:not(.is-register) .auth-toggle-signin-panel,
  .auth-toggle-stage.is-register .auth-toggle-register-panel {
    position: relative;
    height: auto;
    min-height: min(700px, calc(100vh - 124px));
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .auth-toggle-logo { position: static; margin: var(--gutter) var(--gutter) 0; display: inline-flex; }
  .auth-toggle-container { flex-direction: column; padding: 20px var(--gutter) 60px; min-height: 0; }
  .auth-toggle-overlay-wrap { display: none; }
  .auth-toggle-stage {
    height: auto;
    max-height: none;
    min-height: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .auth-toggle-form-panel {
    position: static;
    transform: none !important;
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-md);
    padding: var(--pad-card);
    margin: 0 auto;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .auth-toggle-register-panel { display: none; }
  .auth-toggle-stage.is-register .auth-toggle-signin-panel { display: none; }
  .auth-toggle-stage.is-register .auth-toggle-register-panel { display: flex; }
  .auth-toggle-mobile-link { display: block; }
}

@media (max-width: 720px) {
  /* stacked pairs use the fields' own spacing, so all gaps match */
  .form-row,
  .auth-toggle-register-panel .form-row { grid-template-columns: 1fr; gap: 0; }
}
