/* ===== V2 modal animations (contact, mega-menu, mobile drawer) ===== */
:root {
  --v2-modal-duration: 0.28s;
  --v2-modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.v2-modal-open {
  overflow: hidden;
}

/* Mega menu overlay + panel */
.mega-overlay {
  transition: opacity var(--v2-modal-duration) ease, visibility var(--v2-modal-duration) ease;
}

.mega-panel {
  transform-origin: top center;
}

/* Mobile drawer overlay */
.mobile-drawer-overlay {
  transition: opacity var(--v2-modal-duration) ease, visibility var(--v2-modal-duration) ease;
}

.mobile-drawer {
  transition: transform 0.34s var(--v2-modal-ease);
}

/* ===== V2 contact modal ===== */
.v2-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  pointer-events: none;
}

.v2-contact-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.v2-contact-modal[hidden]:not(.is-open) {
  display: none;
}

.v2-contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--v2-modal-duration) ease;
}

.v2-contact-modal.is-open .v2-contact-modal__backdrop {
  opacity: 1;
}

.v2-contact-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--surface, #fff);
  border-radius: 22px;
  padding: 32px 32px 28px;
  box-shadow: 0 24px 80px rgba(10, 14, 26, 0.28);
  color: var(--ink, #0a0e1a);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition:
    opacity var(--v2-modal-duration) var(--v2-modal-ease),
    transform var(--v2-modal-duration) var(--v2-modal-ease);
}

.v2-contact-modal.is-open .v2-contact-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.v2-contact-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg, #f4f5f7);
  color: var(--ink, #0a0e1a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.v2-contact-modal__close:hover {
  background: var(--brand-light, #e8eef7);
  transform: scale(1.04);
}

.v2-contact-modal__eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--brand, #1656e0);
  font-weight: 600;
  margin-bottom: 10px;
}

.v2-contact-modal__title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 10px;
  padding-right: 36px;
}

.v2-contact-modal__lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted, #6b7280);
  margin-bottom: 22px;
}

.v2-contact-modal__form .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v2-contact-modal__form .form_control,
.v2-contact-modal__form p {
  margin: 0;
}

.v2-contact-modal__form input:not([type="submit"]),
.v2-contact-modal__form textarea,
.v2-contact-modal__form select {
  width: 100%;
  background: var(--bg, #f4f5f7);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ink, #0a0e1a);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.v2-contact-modal__form input:not([type="submit"]):focus,
.v2-contact-modal__form textarea:focus {
  outline: none;
  border-color: var(--brand, #1656e0);
  box-shadow: 0 0 0 3px rgba(22, 86, 224, 0.12);
}

.v2-contact-modal__form input::placeholder,
.v2-contact-modal__form textarea::placeholder {
  color: var(--hint, #9ca3af);
}

.v2-contact-modal__form input[type="submit"],
.v2-contact-modal__form .wpcf7-submit {
  width: 100%;
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  background: var(--ink, #0a0e1a);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.v2-contact-modal__form input[type="submit"]:hover,
.v2-contact-modal__form .wpcf7-submit:hover {
  transform: translateY(-1px);
  background: #1a2030;
}

.v2-contact-modal__form .wpcf7-spinner {
  margin: 8px auto 0;
}

.v2-contact-modal__form .wpcf7-response-output {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--line, #e5e7eb);
}

.v2-contact-modal__form .wpcf7-not-valid-tip {
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
}

.v2-contact-modal__policy {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--hint, #9ca3af);
  text-align: center;
}

@media (max-width: 768px) {
  .v2-contact-modal {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  .v2-contact-modal__dialog {
    width: min(100%, 420px);
    margin: 0 auto;
    border-radius: 18px;
    padding: 24px 20px 22px;
    max-height: min(88vh, 640px);
    max-height: min(88dvh, 640px);
    transform: translateY(24px) scale(0.97);
  }

  .v2-contact-modal.is-open .v2-contact-modal__dialog {
    transform: translateY(0) scale(1);
  }
}

/* ===== Welcome popup (homepage, first visit) ===== */
.v2-welcome-modal .v2-welcome-modal__dialog {
  width: min(100%, 560px);
  padding: 0;
  overflow: hidden;
}

.v2-welcome-modal .v2-contact-modal__close {
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.94);
}

.v2-welcome-modal__media {
  line-height: 0;
  background: var(--ink, #0a0e1a);
}

.v2-welcome-modal__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.v2-welcome-modal__body {
  padding: 28px 32px 30px;
}

.v2-welcome-modal__body .v2-contact-modal__title {
  margin-bottom: 12px;
  padding-right: 28px;
}

.v2-welcome-modal__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted, #6b7280);
  margin-bottom: 20px;
}

.v2-welcome-modal__desc p {
  margin: 0 0 10px;
}

.v2-welcome-modal__desc p:last-child {
  margin-bottom: 0;
}

.v2-welcome-modal__desc ul,
.v2-welcome-modal__desc ol {
  margin: 0 0 12px 18px;
  padding: 0;
}

.v2-welcome-modal__desc li {
  margin-bottom: 6px;
}

.v2-welcome-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--ink, #0a0e1a);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.v2-welcome-modal__cta:hover {
  background: #1a2030;
  transform: translateY(-1px);
  color: #fff;
}

@media (max-width: 768px) {
  .v2-welcome-modal .v2-welcome-modal__dialog {
    width: min(100%, 420px);
  }

  .v2-welcome-modal__body {
    padding: 22px 20px 24px;
  }

  .v2-welcome-modal__media img {
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mega-panel,
  .v2-contact-modal__dialog,
  .v2-contact-modal__backdrop,
  .mobile-drawer,
  .mobile-drawer-overlay,
  .mega-overlay {
    transition: none !important;
    transform: none !important;
  }

  .v2-contact-modal.is-open .v2-contact-modal__dialog,
  .mega-panel.active {
    opacity: 1;
  }
}
