/* Ogilvy Experience Login Gate - robust mobile/tablet */
html.ogilvy-gate-lock,
body.ogilvy-gate-lock {
  overflow: hidden !important;
  touch-action: none;
}

.ogilvy-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ogilvy-gate-modal.is-open {
  display: flex !important;
}

.ogilvy-gate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ogilvy-gate-box {
  position: relative;
  width: min(92vw, 430px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #070707;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
  font-family: inherit;
  box-sizing: border-box;
  transform: translateZ(0);
}

.ogilvy-gate-box h2 {
  margin: 0 44px 22px 0;
  font-size: 28px;
  line-height: 1.1;
  color: #fff;
}

.ogilvy-gate-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.ogilvy-gate-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.86);
}

.ogilvy-gate-form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 15px 14px;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.ogilvy-gate-form input:focus {
  border-color: #ef4048;
  box-shadow: 0 0 0 3px rgba(239,64,72,.25);
}

.ogilvy-gate-error {
  min-height: 20px;
  margin: 6px 0 16px;
  color: #ff7077;
  font-size: 14px;
  font-weight: 700;
}

.ogilvy-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.ogilvy-gate-actions button {
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
}

.ogilvy-gate-cancel {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.ogilvy-gate-submit {
  background: #ef4048;
  color: #fff;
}

@media (max-width: 768px) {
  .ogilvy-gate-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .ogilvy-gate-box {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 22px 22px 18px 18px;
    padding: 26px 22px 22px;
  }

  .ogilvy-gate-box h2 {
    font-size: 24px;
  }

  .ogilvy-gate-actions {
    flex-direction: column-reverse;
  }

  .ogilvy-gate-actions button {
    width: 100%;
  }
}

/* iOS Safari fix: keep modal usable when keyboard/browser bar is visible */
@supports (-webkit-touch-callout: none) {
  .ogilvy-gate-modal {
    align-items: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
  }

  .ogilvy-gate-box {
    margin-top: 18px;
    margin-bottom: 18px;
  }
}
