/* ============================================================
   تدريب — newsletter box ([tadreab_subscribe])
   Namespaced under .tqm-sub. Inherits the surrounding font so it
   sits inside the landing panel without looking bolted on.
   ============================================================ */

.tqm-sub {
  font-family: inherit;
  direction: rtl;
  text-align: right;
}

.tqm-sub-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* ---- field ---- */

.tqm-sub-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  outline: none;
  /* 16px stops iOS Safari zooming the page when the field is focused */
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #10161f;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tqm-sub-input::placeholder {
  color: #9aa2ac;
}

.tqm-sub-input:focus {
  border-color: #1b4fa0;
  box-shadow: 0 0 0 3px rgba(27, 79, 160, 0.12);
}

.tqm-sub.is-invalid .tqm-sub-input {
  border-color: #d38b8b;
  box-shadow: 0 0 0 3px rgba(178, 45, 45, 0.1);
}

/* ---- honeypot: off-screen, never focusable, invisible to people ---- */

.tqm-sub-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- button ---- */

.tqm-sub-btn {
  flex: none;
  position: relative;
  min-width: 116px;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  background: #10161f;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
}

.tqm-sub-btn:hover:not(:disabled) {
  background: #1b4fa0;
  transform: translateY(-1px);
}

.tqm-sub-btn:focus-visible {
  outline: 2px solid #1b4fa0;
  outline-offset: 2px;
}

.tqm-sub-btn:disabled {
  cursor: wait;
  opacity: 0.75;
}

/* the label fades out and the spinner fades in, in place — the button
   keeps its width so the row never jumps mid-submit */
.tqm-sub.is-busy .tqm-sub-btn-text {
  opacity: 0;
}

.tqm-sub-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tqm-sub.is-busy .tqm-sub-spinner {
  opacity: 1;
  animation: tqmSubSpin 0.7s linear infinite;
}

@keyframes tqmSubSpin {
  to { transform: rotate(360deg); }
}

/* ---- small print ---- */

.tqm-sub-note {
  margin: 10px 2px 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: #8a929e;
}

/* ---- the answer ---- */

.tqm-sub-msg {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid transparent;
}

.tqm-sub-msg[hidden] {
  display: none;
}

.tqm-sub-msg.is-info {
  background: #f2f4f7;
  border-color: #e3e6ea;
  color: #5b646f;
}

.tqm-sub-msg.is-ok {
  background: #e6f4ea;
  border-color: #b7ddc2;
  color: #1f6b35;
}

.tqm-sub-msg.is-error {
  background: #fdecec;
  border-color: #f3c9c9;
  color: #8c2020;
}

/* once it has succeeded there is nothing left to submit, so the field and
   button retire and the confirmation stands on its own */
.tqm-sub.is-done .tqm-sub-row,
.tqm-sub.is-done .tqm-sub-note {
  display: none;
}

.tqm-sub.is-done .tqm-sub-msg {
  margin-top: 0;
}

/* ---- mobile ---- */

@media (max-width: 480px) {
  .tqm-sub-row {
    flex-direction: column;
  }

  .tqm-sub-btn {
    width: 100%;
    padding: 13px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tqm-sub-spinner {
    animation: none;
  }
}
