/* ============================================
   AUTH SHELL — viewport-fit layout for /signup-partner, /login,
   /reset-password. Loaded alongside signup.css and overrides its
   legacy-static-site rules at mobile/tablet widths.
   Structure: base rules first, media queries last (largest → smallest).
   ============================================ */

/* ---------- BASE ---------- */

.auth-page {
  --auth-header-h: 90px;
}

/* Sticky header bar, edge-to-edge, content capped at 1360px. Background
   matches the home page header's --surface-soft (recolor-overrides.css),
   hardcoded here so it's correct on every auth page regardless of whether
   that stylesheet happens to be loaded. */
.auth-page .signup-header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FAFBFC;
  border-bottom: 1px solid rgba(217, 219, 233, 0.5);
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: space-between;
  padding: 16px max(40px, calc((100% - 1360px) / 2));
}

/* Always show header actions + collage at any width (signup.css hides them
   at <=1024 for the legacy static-site layout). */
.auth-page .signup-header-bar .header__actions {
  display: flex;
}
.auth-page .signup-collage {
  display: block;
}

/* Secondary button — outline charcoal (for alternative primary actions) */
.auth-page .signup-btn.signup-btn--secondary {
  background: transparent;
  color: #14171C;
  border: 1px solid #14171C;
}
.auth-page .signup-btn.signup-btn--secondary:hover:not(:disabled) {
  background: #14171C;
  color: #FFFFFF;
}

/* Signed-in user avatar — replaces the generic person icon when user is
   authenticated. Brand blue circle with white initial letter. */
.icon-btn.user-avatar {
  background: #155EEF;
  color: #FFFFFF;
  font-family: var(--font-inter), sans-serif;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.user-avatar:hover {
  background: #124FCE;
}

/* Tertiary button — neutral light gray, Airbnb pattern (less attention-grabbing
   than the primary blue or orange. Used for "Try another way", "Skip", etc.) */
.auth-page .signup-btn.signup-btn--tertiary {
  background: #F0F0F0;
  color: #14171C;
  border: none;
}
.auth-page .signup-btn.signup-btn--tertiary:hover:not(:disabled) {
  background: #E4E4E4;
}

/* Header CTA — text by default, brand-blue background on hover */
.auth-header-cta {
  display: inline-block;
  padding: 10px 18px;
  margin-right: 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #14171C;
  font-family: var(--font-inter), sans-serif;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.auth-header-cta:hover,
.auth-header-cta:focus-visible {
  background-color: #155EEF;
  color: #FFFFFF;
}

/* Main area: fills viewport below header; form centered horizontally + vertically */
.auth-page .auth-page__main {
  min-height: calc(100vh - var(--auth-header-h));
  min-height: calc(100dvh - var(--auth-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.auth-page .auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Form is a white rounded card across all breakpoints */
.auth-page .auth-shell__form {
  flex: 1 1 0;
  min-width: 0;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 18px 48px -16px rgba(20, 23, 28, 0.18), 0 4px 14px -6px rgba(20, 23, 28, 0.08);
  padding: 40px 32px;
  box-sizing: border-box;
}

.auth-page .auth-shell__visual {
  flex: 1 1 0;
  min-width: 0;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sign-up hero graphics (partner + client) are the larger, hero side (wider
   column) than the form. */
.auth-page .auth-shell__visual.partner-visual,
.auth-page .auth-shell__visual.client-visual,
.auth-page .auth-shell__visual.signin-visual {
  max-width: 580px;
}

/* Scoped to the legacy photo collage (login / reset-password still use it).
   The sign-up hero GRAPHICS control their own images via their CSS module, so
   this must NOT reach them (it would force height:auto and break fixed-height
   card photos). */
.auth-page .signup-collage img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Input fields — exactly 48px tall per Figma spec, overriding signup.css */
.auth-page .signup-input {
  height: 48px;
  padding: 0 24px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 48px;
}
.auth-page .signup-password-wrap .signup-input {
  padding-right: 52px;
}

/* Mobile-only logo (above form on small screens) — hidden by default */
.auth-mobile-logo {
  display: none;
}

/* ---------- AUTH MODALS ---------- */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.auth-modal {
  position: relative;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 2px 4px 16px rgba(37, 37, 34, 0.16);
  padding: 48px 32px 32px;
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal-close:hover {
  background: #F7F7F7;
}

.auth-modal-title {
  font-family: var(--font-inter), sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #14171C;
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.3;
}

/* ============================================
   MEDIA QUERIES (largest viewport → smallest)
   All scoped with .auth-page for specificity (0,2,0) so they
   always beat the base rules above (0,1,0) regardless of order.
   ============================================ */

/* Small desktop / large tablet (744–1199px) */
@media (max-width: 1199px) {
  .auth-page .auth-shell {
    gap: 32px;
  }
  .auth-page .auth-shell__form,
  .auth-page .auth-shell__visual {
    max-width: 420px;
  }
  .auth-page .auth-header-cta {
    display: none;
  }
}

/* Kill the 80px body bottom padding signup.css adds at <=1024 */
@media (max-width: 1024px) {
  body {
    padding: 0;
  }
}

/* Tablet (744–1023px): image hidden, form takes full available width */
@media (max-width: 1023px) {
  .auth-page {
    --auth-header-h: 80px;
  }
  .auth-page .auth-shell__visual {
    display: none;
  }
  .auth-page .auth-shell__form {
    max-width: 480px;
    flex: 1 1 auto;
  }
}

/* Mobile (<744px): kill header bar, show bigger centered logo above form.
   Page is a flex column filling 100dvh — main flexes to fill remaining
   space (logo + form stack at TOP inside main; footer pinned to bottom). */
@media (max-width: 743px) {
  .auth-page {
    --auth-header-h: 0px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .auth-page .signup-header-bar {
    display: none;
  }
  .auth-mobile-logo {
    display: flex;
    justify-content: center;
    padding: 48px 16px 0;
    margin: 0;
    flex-shrink: 0;
  }
  /* Logo: 32px tall */
  .auth-mobile-logo img {
    width: auto;
    height: 32px;
    display: block;
  }
  /* MAIN: flex column that grows to fill the band between the sticky header
     and the fixed bnav, centering the form vertically (was top-anchored with
     dead space below). flex-grow does the centering, so no hardcoded height. */
  .auth-page .auth-page__main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 16px 32px;
    /* Fill the visible band (viewport minus the ~78px header and the 82px
       fixed-bnav reservation) so the form centers in it; the footer flows
       below the fold. */
    min-height: calc(100vh - 160px);
    min-height: calc(100dvh - 160px);
    flex: 0 0 auto;
  }
  .auth-page .auth-shell {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    gap: 0;
  }
  /* On mobile: centering (via .auth-page__main) handles vertical position,
     so no top margin. Card styling inherits from base. */
  .auth-page .auth-shell__form {
    max-width: 100%;
    margin: 0;
    padding: 32px 24px;
    flex: none;
  }
  /* Push footer to viewport bottom via margin-top: auto in the flex column.
     This guarantees footer sits at viewport bottom regardless of content
     height — no "footer visible above the fold" problem. */
  .auth-page__footer {
    flex-shrink: 0;
    margin-top: auto;
  }
  /* Tight gap between logo and form title (Airbnb pattern) */
  .auth-page .signup-header {
    margin-top: 16px;
  }
  .auth-page .signup-title {
    font-size: 26px;
  }
  /* Modal tweaks for small screens */
  .auth-modal {
    padding: 40px 24px 24px;
    border-radius: 12px;
  }
  .auth-modal-title {
    font-size: 20px;
  }
}
