/* =====================================================
   EVENT SPACES SECTION
===================================================== */

.event-space-section,
.event-space-section * {
  box-sizing: border-box;
}

.event-space-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100svh;
  padding: clamp(120px, 12vh, 150px) 24px 70px;
  overflow: hidden;
}

/* =====================================================
   GREEN DECORATIVE SHAPE
===================================================== */

.event-space-shape {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(600px, 48vw, 676px);
  height: clamp(680px, 58vw, 776px);
  background: radial-gradient(
    175.53% 173.66% at -4.11% -4.11%,
    #22c55e 13.77%,
    #bef264 46.4%,
    rgba(203, 255, 0, 0) 84.99%
  );
  clip-path: polygon(10% 8%, 97% 1%, 91% 86%, 0% 98%);
  transform: translate(-50%, -50%) rotate(180deg);
  transform-origin: center;
  pointer-events: none;
}

/* =====================================================
   DESKTOP CLOSE BUTTON
===================================================== */

.event-space-close {
  position: absolute;
  top: 50%;
  left: 51%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transform: translate(253px, -330px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.event-space-close img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.event-space-close:hover {
  opacity: 0.7;
  transform: translate(253px, -330px) rotate(90deg);
}

.event-space-close:focus-visible {
  outline: 2px solid #cbff00;
  outline-offset: 4px;
}

.event-space-close-mobile {
  display: none;
}

/* =====================================================
   FORM CARD
===================================================== */

.event-space-card {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  padding: 40px 46px 46px;
  background-color: #ffffff;
  color: #171717;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
}

.event-space-title {
  margin: 0 0 8px;
  color: #171717;
  font-size: clamp(21px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.event-space-subtitle {
  max-width: 420px;
  margin: 0 auto 24px;
  color: #666666;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

/* =====================================================
   FORM LAYOUT
===================================================== */

.event-space-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.event-space-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.event-space-field,
.event-space-select-wrapper {
  width: 100%;
  min-width: 0;
}

/* =====================================================
   FORM CONTROLS
===================================================== */

.event-space-field input,
.event-space-field textarea,
.event-space-select-wrapper select {
  display: block;
  width: 100%;
  min-width: 0;
  padding-right: 19px;
  padding-left: 19px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background-color: #f5f5f5;
  color: #171717;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.event-space-field input,
.event-space-select-wrapper select {
  height: 49px;
}

.event-space-field textarea {
  min-height: 100px;
  padding-top: 13px;
  padding-bottom: 13px;
  resize: vertical;
}

.event-space-field input::placeholder,
.event-space-field textarea::placeholder {
  color: #666666;
  opacity: 1;
}

.event-space-field input[type="date"],
.event-space-field input[type="time"] {
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
}

.event-space-field input:focus,
.event-space-field textarea:focus,
.event-space-select-wrapper select:focus {
  border-color: #171717;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(203, 255, 0, 0.22);
}

/* =====================================================
   SELECT CONTROL
===================================================== */

.event-space-select-wrapper {
  position: relative;
}

.event-space-select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 52px;
  cursor: pointer;
}

.event-space-select-arrow {
  position: absolute;
  top: 50%;
  right: 21px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid #171717;
  border-bottom: 1.5px solid #171717;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

/* =====================================================
   SUBMIT BUTTON
===================================================== */

.event-space-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background-color: #cbff00;
  color: #050505;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.event-space-submit:hover {
  background-color: #b9e900;
}

.event-space-submit:active {
  transform: scale(0.99);
}

.event-space-submit:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 3px;
}

.event-space-submit-arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 180ms ease;
}

.event-space-submit:hover .event-space-submit-arrow {
  transform: translateX(4px);
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {
  .event-space-section {
    padding-top: 130px;
    padding-bottom: 60px;
  }

  .event-space-shape {
    width: 620px;
    height: 700px;
  }

  .event-space-close {
    transform: translate(235px, -320px);
  }

  .event-space-close:hover {
    transform: translate(235px, -320px) rotate(90deg);
  }
}

@media (max-width: 700px) {
  .event-space-section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .event-space-shape {
    width: calc(100% - 20px);
    max-width: 620px;
    height: 650px;
  }

  .event-space-card {
    width: min(100%, 520px);
    padding: 36px 32px 40px;
  }

  .event-space-close {
    transform: translate(213px, -300px);
  }

  .event-space-close:hover {
    transform: translate(213px, -300px) rotate(90deg);
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {
  .event-space-section {
    align-items: flex-start;
    min-height: 100svh;
    padding: 96px 17px 40px;
    overflow: visible;
  }

  .event-space-shape {
    display: none;
  }

  .event-space-card {
    width: 100%;
    max-width: 480px;
    padding: 32px 24px 40px;
    border-radius: 24px;
  }

  .event-space-title {
    padding: 0 25px;
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 1.35;
  }

  .event-space-subtitle {
    padding: 0 12px;
    margin-bottom: 24px;
    font-size: 12px;
    line-height: 1.5;
  }

  .event-space-form {
    gap: 16px;
  }

  .event-space-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .event-space-field input,
  .event-space-field textarea,
  .event-space-select-wrapper select {
    padding-right: 14px;
    padding-left: 14px;
    font-size: 16px;
  }

  .event-space-field input,
  .event-space-select-wrapper select {
    height: 48px;
  }

  .event-space-field textarea {
    min-height: 100px;
  }

  .event-space-select-wrapper select {
    padding-right: 42px;
  }

  .event-space-select-arrow {
    right: 17px;
  }

  .event-space-submit {
    min-height: 48px;
    margin-top: 16px;
    font-size: 16px;
  }

  .event-space-close {
    display: none;
  }

  .event-space-close-mobile {
    position: absolute;
    top: 18px;
    right: 18px;
    left: auto;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transform: none;
  }

  .event-space-close-mobile:hover {
    opacity: 0.7;
    transform: rotate(90deg);
  }

  .event-space-close-mobile::before,
  .event-space-close-mobile::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background-color: #666666;
    transform-origin: center;
  }

  .event-space-close-mobile::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .event-space-close-mobile::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .event-space-close-mobile:focus-visible {
    outline: 2px solid #171717;
    outline-offset: 2px;
  }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 420px) {
  .event-space-section {
    padding: 88px 12px 28px;
  }

  .event-space-card {
    padding: 30px 18px 32px;
    border-radius: 20px;
  }

  .event-space-title {
    padding: 0 28px;
    font-size: 17px;
  }

  .event-space-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .event-space-form {
    gap: 16px;
  }
}

/* =====================================================
   SHORT SCREENS
===================================================== */

@media (min-width: 601px) and (max-height: 820px) {
  .event-space-section {
    align-items: flex-start;
    padding-top: 120px;
    padding-bottom: 50px;
    overflow-y: auto;
  }

  .event-space-shape {
    top: 470px;
  }

  .event-space-close {
    top: 470px;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  .event-space-close,
  .event-space-submit,
  .event-space-submit-arrow,
  .event-space-field input,
  .event-space-field textarea,
  .event-space-select-wrapper select {
    transition: none;
  }
}

/* =====================================================
   IN-PAGE MODAL
===================================================== */

body.event-space-modal-open {
  overflow: hidden;
}

body.event-space-modal-open .site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 21000;
  width: 100%;
}

body.event-space-modal-open #mobileMenu {
  z-index: 22000;
}

.event-space-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  visibility: hidden;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  background-color: var(--color-navy);
  background-image:
    radial-gradient(
      circle at 48% -5%,
      rgba(72, 63, 230, 0.46),
      rgba(18, 28, 92, 0.2) 22%,
      rgba(0, 9, 41, 0) 48%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 9, 41, 0.94) 0%,
      rgba(0, 9, 41, 0.9) 58%,
      rgba(0, 0, 0, 0.96) 100%
    );
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    opacity 180ms ease,
    visibility 0s linear 180ms;
}

.event-space-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.event-space-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 9, 41, 0.35);
  cursor: default;
}

.event-space-modal .event-space-section {
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

.event-space-modal .event-space-card {
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.event-space-modal .event-space-close {
  text-decoration: none;
}

@media (max-width: 600px) {
  .event-space-modal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .event-space-modal .event-space-section {
    min-height: 100vh;
    min-height: 100dvh;
  }
}
