/* ============================================================
   LINKMESH - TRIAL MODAL (ISOLATED MODULE)
   Remove this file + js/modal-trial.js when the modal is retired.
   No changes are needed in styles.css.
   ============================================================ */

/* ---------- Overlay ---------- */
.lm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lm-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Dialog ---------- */
.lm-modal {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 440px;
  margin: 1rem;
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease;
}

.lm-modal-overlay.active .lm-modal {
  transform: translateY(0) scale(1);
}

/* ---------- Close Button ---------- */
.lm-modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lm-modal-close:hover {
  background: #F1F4F9;
  color: #111827;
}

.lm-modal-close svg {
  width: 18px;
  height: 18px;
}

/* ---------- Icon (top) ---------- */
.lm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.lm-modal-icon svg {
  width: 24px;
  height: 24px;
  color: #FFFFFF;
}

/* ---------- Headline ---------- */
.lm-modal-headline {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-align: center;
}

/* ---------- Description ---------- */
.lm-modal-desc {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ---------- Form ---------- */
.lm-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lm-modal-form .lm-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.lm-modal-form .lm-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}

.lm-modal-form .lm-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #111827;
  background: #F8F9FB;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lm-modal-form .lm-field input::placeholder {
  color: #9CA3AF;
}

.lm-modal-form .lm-field input:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #FFFFFF;
}

/* ---------- Submit Button ---------- */
.lm-modal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  color: #FFFFFF;
  background: #2563EB;
  border: 1px solid #2563EB;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  margin-top: 0.25rem;
}

.lm-modal-submit:hover {
  background: #1D4ED8;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

.lm-modal-submit:active {
  transform: translateY(1px);
}

/* ---------- Footer microcopy (trial badge style) ---------- */
.lm-modal-footer-text {
  display: inline-block;
  align-self: center;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #FFFFFF;
  background: #10B981;
  padding: 0.55rem 1.75rem;
  border-radius: 9999px;
  margin-top: 1rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.30);
  letter-spacing: 0.01em;
}

/* ---------- Success State ---------- */
.lm-modal.success .lm-modal-headline,
.lm-modal.success .lm-modal-desc,
.lm-modal.success .lm-modal-form,
.lm-modal.success .lm-modal-footer-text {
  display: none;
}

.lm-modal-success {
  display: none;
  text-align: center;
}

.lm-modal.success .lm-modal-success {
  display: block;
}

.lm-modal-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ECFDF5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.lm-modal-success-icon svg {
  width: 28px;
  height: 28px;
  color: #10B981;
}

.lm-modal-success h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.lm-modal-success p {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}

.lm-modal-success p span {
  font-weight: 600;
  color: #374151;
}

/* ---------- Loading spinner inside button ---------- */
.lm-modal-submit .lm-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: lm-spin 0.55s linear infinite;
}

.lm-modal-submit.loading .lm-spinner {
  display: inline-block;
}

.lm-modal-submit.loading .lm-btn-text {
  display: none;
}

.lm-modal-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

@keyframes lm-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .lm-modal {
    margin: 0.75rem;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .lm-modal-headline {
    font-size: 1.125rem;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .lm-modal-overlay,
  .lm-modal-overlay.active .lm-modal,
  .lm-modal-submit {
    transition-duration: 0.01ms !important;
  }
}
