/* ═══════════════════════════════════════════════════════════
   Twingital Mailer — Public Form Styles
   by Twingital Devs · twingital.com
   ═══════════════════════════════════════════════════════════ */

.tm-form-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 100%;
  max-width: 540px;
}

/* ── Title & description ── */
.tm-form-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}
.tm-form-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* ── Name group ── */
.tm-name-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── Field row (email + button) ── */
.tm-field-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* ── Inputs ── */
.tm-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.tm-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.tm-input::placeholder { color: #94a3b8; }

/* Email input fills the remaining space */
.tm-email-input { flex: 1; min-width: 0; }

/* ── Button ── */
.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
  flex-shrink: 0;
  background: #6366f1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.tm-btn:hover   { opacity: .9; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.tm-btn:active  { transform: scale(.97); }
.tm-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Stacked layout ── */
.tm-subscribe-form[data-layout="stacked"] .tm-field-row {
  flex-direction: column;
}
.tm-subscribe-form[data-layout="stacked"] .tm-btn {
  width: 100%;
  height: 46px;
}
.tm-subscribe-form[data-layout="stacked"] .tm-email-input {
  width: 100%;
}

/* ── Message ── */
.tm-message {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.tm-message.tm-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.tm-message.tm-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Loader spinner ── */
.tm-btn-loader {
  display: inline-block;
  animation: tm-spin 1s linear infinite;
}
@keyframes tm-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Sidebar widget context ── */
.widget .tm-form-wrap { max-width: 100%; }
.widget .tm-form-title { font-size: 15px; }

/* ── Elementor context ── */
.elementor-widget-container .tm-form-wrap { max-width: 100%; }

/* ── Confirmation banners (query string feedback) ── */
.tm-notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0;
}
.tm-notice-bar.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.tm-notice-bar.info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .tm-name-group          { grid-template-columns: 1fr; }
  .tm-field-row           { flex-direction: column; }
  .tm-btn                 { width: 100%; }
  .tm-btn, .tm-input      { height: 46px; }
}
