.preview-modal[hidden] {
  display: none;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.74);
  backdrop-filter: blur(10px);
}

.preview-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 1.5rem));
  margin: min(5vh, 3rem) auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.34);
}

.preview-modal__media {
  min-height: 540px;
  background: #d9d9d9;
}

.preview-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-modal__content {
  position: relative;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
}

.preview-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 23, 31, 0.07);
  color: #1b232c;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.preview-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-accent) 14%, #fff);
  color: color-mix(in srgb, var(--page-accent) 84%, #12171d);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-modal__title {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.04;
}

.preview-modal__copy {
  margin: 1rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.preview-modal__quote {
  margin: 1.3rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--page-accent);
  border-radius: 0 18px 18px 0;
  background: rgba(15, 22, 30, 0.04);
  color: #35404a;
  font-style: italic;
}

.preview-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: auto;
  padding-top: 2rem;
}

/* Both panels must fill the content column */
#preview-modal-cta {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#preview-modal-cta[hidden] {
  display: none;
}

/* Inline form panel */
.preview-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preview-modal__form[hidden] {
  display: none;
}

.preview-modal__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
}

.preview-modal__back:hover {
  color: var(--text);
}

.preview-modal__form-hint {
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.preview-modal__form .field {
  margin-bottom: 0.9rem;
}

.preview-modal__form .button-block {
  margin-top: 0.5rem;
}

/* Success state */
.preview-modal__sent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.preview-modal__sent[hidden] {
  display: none;
}

.preview-modal__sent h3 {
  margin: 0;
  font-size: 1.4rem;
}

.preview-modal__sent p {
  margin: 0 0 1rem;
  color: var(--text-soft);
}

.preview-modal__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--page-accent) 14%, #fff);
  color: var(--page-accent);
  font-size: 1.5rem;
  font-weight: 700;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .preview-modal__dialog {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
  }

  .preview-modal__media {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .preview-modal__dialog {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
    border-radius: 24px;
  }

  .preview-modal__content {
    padding: 1.3rem;
  }

  .preview-modal__actions .button {
    width: 100%;
  }
}
