/**
 * ================================================================
 * M31 LABS - RESEARCHER VERIFICATION GATE PAGE
 * ================================================================
 * 
 * Dark luxury gate page:
 * - Dark background (M31 brand aesthetic)
 * - Dark form container with gold accents
 * - Logo visible on dark
 * - Professional, minimal design
 * - Two-checkbox validation (age + researcher)
 */

/* ================================================================
   GATE PAGE CONTAINER - ONLY APPLIES WHEN GATE IS ACTIVE
   ================================================================ */

.m31-gate-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.m31-gate-container body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Only affect Divi elements INSIDE gate container */
.m31-gate-container #page-container,
.m31-gate-container #et-main-area,
.m31-gate-container .et_pb_section,
.m31-gate-container .et_pb_row {
  height: 100%;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide header/footer only on gate page */
.m31-gate-container #main-header,
.m31-gate-container .m31-header,
.m31-gate-container #main-footer,
.m31-gate-container .m31-footer,
.m31-gate-container .m31-disclaimer-bar,
.m31-gate-container header,
.m31-gate-container footer {
  display: none !important;
}

/* ================================================================
   GATE CONTAINER - DARK LUXURY BACKGROUND
   ================================================================ */

.m31-gate-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(201, 162, 75, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(201, 162, 75, 0.06) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 20px;
  box-sizing: border-box;
  z-index: 9999;
}

/* ================================================================
   GATE CONTENT - DARK LUXURY CARD WITH GOLD ACCENTS
   ================================================================ */

.m31-gate-content {
  position: relative;
  z-index: 10;
  text-align: center;
  width: 100%;
  max-width: 520px;
  padding: 35px 50px 32px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(201, 162, 75, 0.3);
  border-radius: 3px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(201, 162, 75, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: m31-gate-entrance 0.6s ease-out;
}

@keyframes m31-gate-entrance {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   LOGO SECTION
   ================================================================ */

.m31-gate-logo {
  margin: -20px 0 16px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
}

.m31-gate-logo img {
  max-height: 50px;
  width: auto;
  display: block;
  filter: brightness(1.1);
}

/* ================================================================
   TYPOGRAPHY - CLEAN & READABLE ON DARK
   ================================================================ */

.m31-gate-content h1,
.m31-gate-content h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.m31-gate-content p {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(207, 202, 189, 0.85);
  margin: 0 0 3px 0;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ================================================================
   FORM CONTAINER
   ================================================================ */

.m31-verify-form {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0px;
}

/* ================================================================
   CHECKBOX STYLING - LUXURY MINIMAL
   ================================================================ */

.m31-verification-checkbox-group {
  text-align: left;
}

.m31-verification-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(207, 202, 189, 0.9);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  transition: color 0.2s ease;
}

.m31-verification-checkbox:hover {
  color: rgb(207, 202, 189);
}

.m31-verification-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: rgb(201, 162, 75);
  border: 1.5px solid rgba(201, 162, 75, 0.5);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.m31-verification-checkbox input[type="checkbox"]:hover {
  border-color: rgb(201, 162, 75);
  background: rgba(201, 162, 75, 0.08);
  box-shadow: 0 0 12px rgba(201, 162, 75, 0.2);
}

.m31-verification-checkbox input[type="checkbox"]:checked {
  border-color: rgb(201, 162, 75);
  background: rgba(201, 162, 75, 0.15);
  box-shadow: 0 0 16px rgba(201, 162, 75, 0.3);
}

.m31-verification-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid rgb(201, 162, 75);
  outline-offset: 2px;
  border-color: rgb(220, 180, 90);
}

.m31-checkbox-label {
  display: block;
  font-weight: 400;
  color: rgba(207, 202, 189, 0.9);
}

.m31-checkbox-label strong {
  font-weight: 600;
  color: rgb(220, 180, 90);
  letter-spacing: 0.3px;
}

/* ================================================================
   SUBMIT BUTTON - DARK LUXURY STATES
   ================================================================ */

.m31-gate-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 30px !important;
  height: auto !important;
  background: linear-gradient(135deg, rgb(246, 227, 166), rgb(201, 162, 75) 60%, rgb(185, 143, 62)) !important;
  border: none !important;
  border-radius: 100px !important;
  color: rgb(16, 12, 4) !important;
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  text-transform: uppercase !important;
  margin-top: 2px !important;
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.2) !important;
  -webkit-font-smoothing: antialiased !important;
  line-height: 0.85 !important;
  text-align: center !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* DISABLED STATE */
.m31-gate-submit:disabled,
.m31-gate-submit[disabled],
.m31-gate-submit.is-disabled {
  background: linear-gradient(135deg, #777, #555 60%, #444) !important;
  color: #999 !important;
  cursor: not-allowed !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  opacity: 0.65 !important;
  transform: none !important;
}

/* ENABLED STATE - HOVER */
.m31-gate-submit:not(:disabled):not(.is-disabled):hover,
.m31-gate-submit.is-enabled:hover {
  background: linear-gradient(135deg, rgb(255, 240, 180), rgb(220, 180, 90) 60%, rgb(200, 160, 70)) !important;
  box-shadow: 0 8px 20px rgba(201, 162, 75, 0.3) !important;
  transform: translateY(-1px) !important;
  opacity: 1 !important;
}

/* ENABLED STATE - ACTIVE */
.m31-gate-submit:not(:disabled):not(.is-disabled):active,
.m31-gate-submit.is-enabled:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(201, 162, 75, 0.15);
}

/* ENABLED STATE - FOCUS */
.m31-gate-submit:not(:disabled):not(.is-disabled):focus-visible,
.m31-gate-submit.is-enabled:focus-visible {
  outline: 2px solid rgb(220, 180, 90);
  outline-offset: 2px;
}

/* LOADING STATE */
.m31-gate-submit.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ================================================================
   EXIT LINK
   ================================================================ */

.m31-gate-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(201, 162, 75, 0.2);
}

.m31-gate-exit {
  display: inline-block;
  font-size: 12px;
  color: rgba(201, 162, 75, 0.7);
  text-decoration: none;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  transition: color 0.2s ease;
  cursor: pointer;
}

.m31-gate-exit:hover {
  color: rgb(201, 162, 75);
}

/* ================================================================
   DISCLAIMER TEXT
   ================================================================ */

.m31-gate-disclaimer {
  margin-top: 8px;
  padding: 0;
}

.m31-gate-disclaimer p {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(207, 202, 189, 0.65);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.m31-gate-disclaimer a {
  color: rgba(201, 162, 75, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.m31-gate-disclaimer a:hover {
  color: rgb(201, 162, 75);
  text-decoration: underline;
}

/* ================================================================
   FLOATING BOTTLES - SUBTLE LUXURY EFFECT
   ================================================================ */

.m31-bottles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.m31-bottle {
  position: fixed;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.22;
  filter: brightness(1.6) blur(0.5px);
  animation: m31-float-up 30s linear infinite;
  mix-blend-mode: screen;
  will-change: transform;
}

/* Bottle sizing - variable via data-size */
.m31-bottle[data-size="small"] {
  width: 60px;
  height: 90px;
}

.m31-bottle[data-size="medium"] {
  width: 90px;
  height: 135px;
}

.m31-bottle[data-size="large"] {
  width: 130px;
  height: 195px;
}

/* Float upwards from bottom to top with dynamic wobble */
@keyframes m31-float-up {
  0% {
    transform: translateY(0) rotateZ(-3deg);
    opacity: 0;
  }
  2% {
    opacity: 0.22;
  }
  15% {
    transform: translateY(-15vh) rotateZ(4deg);
  }
  25% {
    transform: translateY(-25vh) rotateZ(-2deg);
  }
  40% {
    transform: translateY(-40vh) rotateZ(5deg);
  }
  50% {
    transform: translateY(-50vh) rotateZ(-3deg);
  }
  65% {
    transform: translateY(-65vh) rotateZ(4deg);
  }
  75% {
    transform: translateY(-75vh) rotateZ(-4deg);
  }
  90% {
    transform: translateY(-105vh) rotateZ(3deg);
  }
  98% {
    opacity: 0.22;
  }
  100% {
    transform: translateY(-130vh) rotateZ(-2deg);
    opacity: 0;
  }
}

/* ================================================================
   MOBILE RESPONSIVE - TABLET (768px)
   ================================================================ */

@media (max-width: 768px) {
  .m31-gate-container {
    padding: 15px 12px;
  }
  
  .m31-gate-content {
    max-width: 100%;
    padding: 28px 28px 26px;
  }
  
  .m31-gate-logo {
    margin: -16px 0 12px 0;
    min-height: 32px;
  }
  
  .m31-gate-logo img {
    max-height: 32px;
  }
  
  .m31-gate-content h1,
  .m31-gate-content h2 {
    font-size: 22px;
    margin-bottom: 4px;
  }
  
  .m31-gate-content p {
    font-size: 12px;
    margin-bottom: 3px;
  }
  
  .m31-verification-checkbox {
    font-size: 12px;
  }
  
  .m31-verify-form {
    gap: 3px;
    margin-top: 0px;
  }
  
  .m31-gate-submit {
    padding: 8px 25px !important;
    height: auto !important;
    font-size: 12px !important;
    margin-top: 2px !important;
    line-height: 0.85 !important;
  }
  
  .m31-gate-footer {
    margin-top: 9px;
    padding-top: 8px;
  }
  
  .m31-gate-disclaimer {
    margin-top: 7px;
  }
  
  .m31-gate-disclaimer p {
    font-size: 11px;
  }
  
  .m31-bottle[data-size="small"] {
    width: 50px;
    height: 75px;
  }
  
  .m31-bottle[data-size="medium"] {
    width: 75px;
    height: 110px;
  }
  
  .m31-bottle[data-size="large"] {
    width: 110px;
    height: 160px;
  }
}

/* ================================================================
   MOBILE RESPONSIVE - PHONE (480px)
   ================================================================ */

@media (max-width: 480px) {
  .m31-gate-container {
    padding: 12px 10px;
  }
  
  .m31-gate-content {
    max-width: 100%;
    padding: 24px 20px;
  }
  
  .m31-gate-logo {
    margin: -14px 0 10px 0;
    min-height: 28px;
  }
  
  .m31-gate-logo img {
    max-height: 28px;
  }
  
  .m31-gate-content h1,
  .m31-gate-content h2 {
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  .m31-gate-content p {
    font-size: 12px;
    margin-bottom: 3px;
  }
  
  .m31-verify-form {
    gap: 3px;
    margin-top: 0px;
  }
  
  .m31-verification-checkbox {
    font-size: 12px;
    line-height: 1.5;
  }
  
  .m31-gate-submit {
    padding: 7px 22px !important;
    height: auto !important;
    font-size: 11px !important;
    margin-top: 2px !important;
    line-height: 0.85 !important;
  }
  
  .m31-gate-footer {
    margin-top: 8px;
    padding-top: 7px;
  }
  
  .m31-gate-exit {
    font-size: 11px;
  }
  
  .m31-gate-disclaimer {
    margin-top: 7px;
  }
  
  .m31-gate-disclaimer p {
    font-size: 10px;
  }
  
  .m31-bottle[data-size="small"] {
    width: 35px;
    height: 52px;
    opacity: 0.18;
  }
  
  .m31-bottle[data-size="medium"] {
    width: 55px;
    height: 82px;
    opacity: 0.18;
  }
  
  .m31-bottle[data-size="large"] {
    width: 80px;
    height: 120px;
    opacity: 0.18;
  }
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  .m31-gate-content {
    animation: none;
  }
  
  .m31-bottle {
    animation: none !important;
    opacity: 0.08;
  }
  
  .m31-gate-submit,
  .m31-verification-checkbox input[type="checkbox"] {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  .m31-gate-content {
    border-color: rgba(201, 162, 75, 0.6);
  }
  
  .m31-gate-submit:not(:disabled):not(.is-disabled) {
    border: 1px solid rgb(201, 162, 75);
  }
}

/* ================================================================
   PRINT STYLES
   ================================================================ */

@media print {
  .m31-gate-container {
    background: #f5f5f5;
    position: static;
    width: 100%;
    height: auto;
  }
  
  .m31-gate-content {
    background: white;
    box-shadow: 0 0 0 1px #ccc;
  }
  
  .m31-bottle {
    display: none;
  }
}
