/* Trial signup modal — layout premium SaaS */
.trial-modal.checkout-modal {
  padding: 20px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.modal-open,
body.modal-open {
  overscroll-behavior: none;
}

.trial-modal__panel {
  position: relative;
  display: flex;
  width: min(calc(100vw - 40px), 960px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(214, 161, 143, 0.08);
}

.trial-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.trial-modal__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.trial-modal__close:focus-visible {
  outline: 3px solid rgba(184, 124, 106, 0.35);
  outline-offset: 2px;
}

.trial-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  width: 100%;
  max-height: inherit;
  min-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.trial-modal__aside {
  padding: 36px 28px 28px;
  background: linear-gradient(165deg, #faf7f5 0%, #f5e8e2 55%, rgba(214, 161, 143, 0.32) 100%);
  border-radius: 20px 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trial-modal__aside-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.trial-modal__aside-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(214, 161, 143, 0.12);
}

.trial-modal__aside-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #181818;
  line-height: 1.25;
}

.trial-modal__aside-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
}

.trial-modal__benefits {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.trial-modal__benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(214, 161, 143, 0.12);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #181818;
}

.trial-modal__benefit-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
}

.trial-modal__aside-highlight {
  margin-top: auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(214, 161, 143, 0.18);
  border-radius: 14px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  color: #5c524e;
}

.trial-modal__form-col {
  padding: 32px 32px 28px;
}

.trial-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.trial-modal__header-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(242, 199, 184, 0.72), rgba(214, 161, 143, 0.3));
  color: #b87c6a;
  border-radius: 12px;
}

.trial-modal__header h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.trial-modal__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.trial-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trial-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trial-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trial-field--full {
  grid-column: 1 / -1;
}

.trial-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.trial-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.trial-field__icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.75;
}

.trial-field__input-wrap input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 40px 12px 40px;
  font: inherit;
  font-size: 0.92rem;
  color: #0f172a;
  background: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.trial-field__input-wrap input:focus {
  outline: none;
  border-color: #B87C6A;
  box-shadow: 0 0 0 3px rgba(214, 161, 143, 0.15);
}

.trial-field__input-wrap input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.trial-field__input-wrap input.is-valid {
  border-color: #10b981;
}

.trial-field__toggle {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.55;
  padding: 4px 6px;
  line-height: 1;
}

.trial-field__toggle:hover {
  opacity: 0.9;
}

.trial-field__error {
  font-size: 0.78rem;
  color: #dc2626;
  font-weight: 500;
}

.trial-field__hint {
  font-size: 0.78rem;
  font-weight: 500;
}

.trial-field__hint.is-match {
  color: #B87C6A;
}

.trial-field__hint.is-mismatch {
  color: #dc2626;
}

.trial-password-strength {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trial-password-strength__bar {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.trial-password-strength__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition:
    width 0.2s ease,
    background 0.2s ease;
}

.trial-password-strength__bar span[data-strength='weak'] {
  width: 33%;
  background: #ef4444;
}

.trial-password-strength__bar span[data-strength='medium'] {
  width: 66%;
  background: #f59e0b;
}

.trial-password-strength__bar span[data-strength='strong'] {
  width: 100%;
  background: #10b981;
}

.trial-password-strength__label {
  font-size: 0.75rem;
  color: #64748b;
}

.trial-security-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #faf7f5 0%, #f7ece7 100%);
  border: 1px solid rgba(214, 161, 143, 0.18);
}

.trial-security-banner__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.trial-security-banner strong {
  display: block;
  font-size: 0.88rem;
  color: #181818;
  margin-bottom: 2px;
}

.trial-security-banner p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #475569;
}

.trial-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 16px 20px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #181818;
  cursor: pointer;
  background: linear-gradient(135deg, #f2c7b8 0%, #d6a18f 50%, #b87c6a 100%);
  box-shadow:
    0 8px 24px rgba(214, 161, 143, 0.35),
    0 2px 6px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.trial-submit-btn svg {
  width: 18px;
  height: 18px;
}

.trial-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(214, 161, 143, 0.4),
    0 4px 10px rgba(15, 23, 42, 0.1);
}

.trial-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.trial-terms {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #64748b;
}

.trial-terms a {
  color: #b87c6a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.trial-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 860px) {
  .trial-modal__grid {
    grid-template-columns: 1fr;
  }

  .trial-modal__aside {
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 20px;
  }

  .trial-modal__aside-highlight {
    margin-top: 8px;
  }

  .trial-modal__form-col {
    padding: 24px 20px 22px;
  }

  .trial-form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .trial-modal.checkout-modal {
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }

  .trial-modal__panel {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }

  .trial-modal__close {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  }

  .trial-modal__aside-visual {
    display: none;
  }

  .trial-modal__aside {
    padding: 18px 16px 14px;
    gap: 10px;
  }

  .trial-modal__aside-title {
    max-width: calc(100% - 48px);
    font-size: 1.08rem;
  }

  .trial-modal__aside-lead,
  .trial-modal__aside-highlight {
    font-size: 0.82rem;
  }

  .trial-modal__benefits {
    gap: 8px;
  }

  .trial-modal__benefits li {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .trial-modal__form-col {
    padding: 20px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .trial-modal__header {
    gap: 10px;
    margin-bottom: 16px;
  }

  .trial-modal__header-badge {
    width: 38px;
    height: 38px;
  }

  .trial-modal__header h2 {
    font-size: 1.12rem;
  }

  .trial-form {
    gap: 12px;
  }

  .trial-field__input-wrap input {
    min-height: 46px;
    font-size: 16px;
  }

  .trial-security-banner {
    padding: 12px;
  }
}
