/*
 * Guest Auth (landing-page login/signup) - nav button + modal.
 *
 * Everything below is scoped to either the new .nav-btn-ghost /
 * .guest-nav-account classes (checked against the rest of the codebase -
 * no existing selector uses these names) or the #guestAuthOverlay
 * wrapper. This is deliberate: main.css already defines global
 * .btn-primary / .btn-outline-primary via Bootstrap CSS vars for the
 * WHOLE site, and the approved mockup happens to reuse those exact class
 * names (.btn-primary, .btn-outline, .link, .tab, .field, .view, ...)
 * for its own modal buttons/inputs. Redefining those globally would
 * restyle Bootstrap buttons everywhere else on the site, so every one of
 * the mockup's modal rules is nested under #guestAuthOverlay here - same
 * class names as the mockup (markup below matches it exactly), just
 * scoped selectors so nothing bleeds outside the modal.
 *
 * Colors match the mockup's --ivory/--lagoon/--deep-lagoon/--gold
 * exactly, using the site's own existing brand tokens (main.css:
 * --ek-color-base/primary/secondary/accent) instead of introducing a
 * second, parallel set of color variables.
 */

/* ---- Nav button (logged-out) / account name (logged-in) ---- */

.nav-btn-ghost {
  display: inline-flex;
  align-items: center;
  color: #1B3A33;
  border: 1px solid rgba(27, 58, 51, 0.3);
  background: transparent;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.nav-btn-ghost:hover {
  border-color: #1B3A33;
  background: rgba(27, 58, 51, 0.05);
}

/* Same transparent/scrolled treatment .gs-nav__owners-link already gets
   on the homepage hero (see monthly-stay-landing.css) - ghost button needs to
   read against the video the same way the "For Owners" link does. */
.gs-nav--transparent .nav-btn-ghost {
  color: var(--ivory-dim, #E8E2D2);
  border-color: rgba(245, 241, 231, 0.4);
}
.gs-nav--transparent .nav-btn-ghost:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(245, 241, 231, 0.1);
}
.gs-nav--transparent.gs-nav--scrolled .nav-btn-ghost {
  color: #1B3A33;
  border-color: rgba(27, 58, 51, 0.3);
}
.gs-nav--transparent.gs-nav--scrolled .nav-btn-ghost:hover {
  color: #1B3A33;
  border-color: #1B3A33;
  background: rgba(27, 58, 51, 0.05);
}

.guest-nav-account {
  position: relative;
}
.guest-nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(27, 58, 51, 0.18);
  padding: 6px;
  z-index: 20;
}
.guest-nav-dropdown.open {
  display: block;
}
.guest-nav-dropdown button,
.guest-nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: #1B3A33;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
}
.guest-nav-dropdown button:hover,
.guest-nav-dropdown a:hover {
  background: rgba(27, 58, 51, 0.06);
}
.guest-nav-unread-badge {
  background: #C9A063;
  color: #1B3A33;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
}

/* ---- Modal ---- */

/*
 * Two separate mobile-Safari fixes layered here, found across several
 * rounds of real-device testing - both needed, neither alone was enough:
 *
 * 1. backdrop-filter isolation: .auth-card and its inputs used to be
 *    composited DESCENDANTS of the blurred, fixed overlay itself. iOS
 *    Safari has documented bugs where a GPU-composited backdrop-filter
 *    layer fails to correctly hit-test/forward touch to its own
 *    descendants. Fixed by moving the blur onto .overlay-backdrop, a
 *    plain sibling of .auth-card (not an ancestor), stacked behind it via
 *    z-index rather than DOM nesting.
 *
 * 2. The "onclick on an ancestor blocks descendant taps" quirk: the
 *    click-to-close-on-backdrop-tap handler used to live on THIS element
 *    (#guestAuthOverlay itself), which contains .auth-card and every
 *    input. iOS Safari has a long-documented behavior where an element
 *    with an onclick handler that CONTAINS other interactive elements can
 *    require an extra "wasted" first tap on those descendants before
 *    they respond normally - this alone reproduces "can't type," and
 *    reproduces it ONLY on real iOS touch (not DevTools emulation, not
 *    desktop, not admin/owner login which don't share this markup at
 *    all). Fixed the same way as #1: the onclick now lives on
 *    .overlay-backdrop, a sibling of .auth-card, so .auth-card's inputs
 *    are never descendants of any onclick-bearing element.
 *
 * Both fixes are really the same structural move: nothing interactive
 * lives inside .overlay-backdrop's subtree, and .auth-card lives outside
 * it entirely (siblings, stacked by z-index).
 */
#guestAuthOverlay.overlay {
  position: fixed;
  inset: 0;
  display: none;
  /* Explicit, redundant belt-and-braces on top of display:none - a
     display:none element is already removed from hit-testing entirely per
     spec, so this should be a no-op. Kept as cheap defensive insurance. */
  pointer-events: none;
  align-items: center;
  justify-content: center;
  z-index: 1080;
  padding: 24px;
}
#guestAuthOverlay.overlay.open {
  display: flex;
  pointer-events: auto;
}
#guestAuthOverlay .overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 51, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 0;
  cursor: pointer;
}

#guestAuthOverlay .auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--ek-color-base, #F5F1E7);
  color: var(--ek-color-secondary, #1B3A33);
  border-radius: 10px;
  padding: 44px 40px 36px;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', sans-serif;
}

#guestAuthOverlay .close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(27, 58, 51, 0.5);
  font-size: 20px;
  line-height: 1;
}
#guestAuthOverlay .close-btn:hover {
  color: var(--ek-color-secondary, #1B3A33);
}

/* Real site logo (partials/auth-brand-mark.blade.php) in place of the
   mockup's placeholder SVG - .auth-brand itself has no global styling
   (it's only ever defined scoped, same as here and in
   partials/auth-page-styles.blade.php for the admin auth screens), so
   the flex layout + compact sizing live here. .gs-nav__mark/.gs-nav__wordmark
   are the real global classes already styled site-wide in main.css;
   these overrides just shrink them to fit the modal card, same numbers
   auth-page-styles.blade.php already uses for its own compact auth-brand. */
#guestAuthOverlay .auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
#guestAuthOverlay .auth-brand .gs-nav__mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
#guestAuthOverlay .auth-brand .gs-nav__mark svg {
  width: 20px;
  height: 20px;
}
#guestAuthOverlay .auth-brand .gs-nav__wordmark {
  font-size: 20px;
}

#guestAuthOverlay .auth-headline {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.3;
  margin: 0 0 28px;
}

#guestAuthOverlay .tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid rgba(27, 58, 51, 0.12);
  margin-bottom: 24px;
}
#guestAuthOverlay .tab {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  background: none;
  border: none;
  padding: 0 0 12px;
  cursor: pointer;
  color: rgba(27, 58, 51, 0.4);
  position: relative;
}
#guestAuthOverlay .tab.active {
  color: var(--ek-color-secondary, #1B3A33);
}
#guestAuthOverlay .tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ek-color-primary, #2F6F63);
}

#guestAuthOverlay .view {
  display: none;
}
#guestAuthOverlay .view.active {
  display: block;
}

#guestAuthOverlay .btn-outline {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--ek-color-secondary, #1B3A33);
  border: 1px solid rgba(27, 58, 51, 0.2);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  transition: border-color .15s ease, background .15s ease;
  text-decoration: none;
}
#guestAuthOverlay .btn-outline:hover {
  border-color: var(--ek-color-primary, #2F6F63);
  background: rgba(47, 111, 99, 0.10);
}

#guestAuthOverlay .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: rgba(27, 58, 51, 0.4);
  font-size: 12px;
}
#guestAuthOverlay .divider::before,
#guestAuthOverlay .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(27, 58, 51, 0.12);
}

#guestAuthOverlay .field {
  margin-bottom: 14px;
}
#guestAuthOverlay .field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid rgba(27, 58, 51, 0.16);
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: var(--ek-color-secondary, #1B3A33);
  font-family: 'Inter', sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#guestAuthOverlay .field input::placeholder {
  color: rgba(27, 58, 51, 0.32);
}
#guestAuthOverlay .field input:focus {
  border-color: var(--ek-color-primary, #2F6F63);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.10);
}
#guestAuthOverlay .field input.is-invalid {
  border-color: #C0392B;
}
#guestAuthOverlay .field-error {
  display: none;
  color: #C0392B;
  font-size: 12px;
  margin: 6px 0 0;
}
#guestAuthOverlay .field-error.show {
  display: block;
}

#guestAuthOverlay .row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#guestAuthOverlay .aux-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 16px;
}
#guestAuthOverlay .link {
  color: var(--ek-color-primary, #2F6F63);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
#guestAuthOverlay .link:hover {
  text-decoration: underline;
}

#guestAuthOverlay .checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: rgba(27, 58, 51, 0.7);
  line-height: 1.45;
  margin-bottom: 18px;
}
#guestAuthOverlay .checkbox-line input {
  margin-top: 3px;
  accent-color: var(--ek-color-primary, #2F6F63);
}

#guestAuthOverlay .btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--ek-color-primary, #2F6F63);
  color: var(--ek-color-base, #F5F1E7);
  border: none;
  border-radius: 5px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
#guestAuthOverlay .btn-primary:hover {
  background: #255a50;
}
#guestAuthOverlay .btn-primary:disabled {
  opacity: 0.65;
  cursor: default;
}

#guestAuthOverlay .switch-line {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: rgba(27, 58, 51, 0.65);
}

#guestAuthOverlay .form-error {
  display: none;
  background: rgba(192, 57, 43, 0.08);
  color: #C0392B;
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
#guestAuthOverlay .form-error.show {
  display: block;
}

#guestAuthOverlay .form-success {
  display: none;
  background: rgba(47, 111, 99, 0.08);
  color: var(--ek-color-primary, #2F6F63);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
#guestAuthOverlay .form-success.show {
  display: block;
}

@media (max-width: 480px) {
  #guestAuthOverlay .auth-card {
    padding: 36px 24px 28px;
  }
  #guestAuthOverlay .row-two {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
