/* Trial modal styles with improved mobile responsiveness */
body.trial-modal-open {
  overflow: hidden;
}

.trial-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100vw;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.trial-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.trial-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 27, 0.68);
  backdrop-filter: blur(10px);
}

.trial-modal__panel {
  position: relative;
  width: min(100%, 560px);
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 28px;
  padding: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.98) 100%);
  box-shadow: 0 28px 70px rgba(4, 16, 34, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.65);
  z-index: 1;
}

.trial-modal__panel::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  border-radius: 28px 0 120px 0;
  background: radial-gradient(circle at top left, rgba(0, 231, 133, 0.22), transparent 70%);
  pointer-events: none;
}

.trial-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 17, 30, 0.06);
  color: #132033;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.trial-modal__close:hover {
  transform: scale(1.04);
  background: rgba(7, 17, 30, 0.11);
}

.trial-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 231, 133, 0.12);
  color: #006a43;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trial-modal__panel h3 {
  margin: 0 0 12px;
  color: #091827;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.trial-modal__panel p {
  margin: 0;
  color: #425466;
  font-size: 16px;
  line-height: 1.6;
}

.trial-modal__form {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.trial-field {
  display: grid;
  gap: 8px;
}

.trial-field label {
  font-size: 14px;
  font-weight: 700;
  color: #182235;
}

.trial-field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  color: #0e1726;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.trial-field input::placeholder {
  color: #7a8699;
}

.trial-field input:focus {
  border-color: #00e785;
  box-shadow: 0 0 0 4px rgba(0, 231, 133, 0.18);
}

.trial-field__error {
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #c53030;
}

.trial-modal__note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0, 231, 133, 0.08);
  color: #20503a;
  font-size: 14px;
  line-height: 1.5;
}

.trial-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 4px;
}

.trial-modal__secondary,
.trial-modal__primary {
  height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.trial-modal__secondary {
  background: #edf2f7;
  color: #253243;
}

.trial-modal__primary {
  background: linear-gradient(135deg, #00e785 0%, #00c96f 100%);
  color: #052112;
  box-shadow: 0 16px 26px rgba(0, 231, 133, 0.26);
}

.trial-modal__secondary:hover,
.trial-modal__primary:hover {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .trial-modal {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    align-items: flex-end;
  }

  .trial-modal__panel {
    width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    padding: 24px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }

  .trial-modal__panel h3 {
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.12;
  }

  .trial-modal__form {
    gap: 14px;
    margin-top: 16px;
  }

  .trial-modal__actions {
    flex-direction: column-reverse;
  }

  .trial-modal__secondary,
  .trial-modal__primary {
    width: 100%;
  }
}
