/* SmartPOS secure M-Pesa module. Isolated to spm-* classes. */
.spm-panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.spm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.spm-header h3 {
  margin: 0 0 5px;
}

.spm-header p {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.spm-status {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.spm-status.active {
  background: #dcfce7;
  color: #15803d;
}

.spm-status.error,
.spm-status.disabled {
  background: #fee2e2;
  color: #b91c1c;
}

.spm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.spm-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.spm-field label {
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.spm-field input,
.spm-field select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
}

.spm-field input:focus,
.spm-field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: #2563eb;
}

.spm-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #334155;
  line-height: 1.45;
}

.spm-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.spm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}

.spm-button {
  min-height: 43px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.spm-button.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.spm-button.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.spm-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.spm-message {
  margin: 15px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: #eff6ff;
  color: #1d4ed8;
  line-height: 1.5;
  font-weight: 650;
}

.spm-message.success {
  background: #dcfce7;
  color: #15803d;
}

.spm-message.error {
  background: #fee2e2;
  color: #b91c1c;
}

.spm-security-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  line-height: 1.5;
}

.spm-payment-progress {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  line-height: 1.45;
}

.spm-license-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 6, 23, 0.94);
}

.spm-license-overlay.active {
  display: flex;
}

.spm-license-card {
  width: min(470px, 100%);
  padding: 30px;
  border-radius: 22px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.spm-license-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 17px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 32px;
}

.spm-license-card h2 {
  margin: 0 0 10px;
}

.spm-license-card p {
  margin: 0 0 18px;
  color: #475569;
  line-height: 1.6;
}

.spm-license-detail {
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 11px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.spm-license-actions {
  display: grid;
  gap: 10px;
}

.spm-grace-banner {
  position: fixed;
  left: 50%;
  top: 10px;
  z-index: 2147483000;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 24px));
  padding: 11px 16px;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 720px) {
  .spm-panel {
    padding: 16px;
  }

  .spm-header {
    flex-direction: column;
  }

  .spm-grid {
    grid-template-columns: 1fr;
  }

  .spm-field.full {
    grid-column: auto;
  }

  .spm-actions {
    flex-direction: column;
  }

  .spm-button {
    width: 100%;
  }
}
