/* ——— Frontend Form ——— */
.msof-form {
  max-width: 720px;
  margin: 1em 0;
  background: #fff;
  padding: 24px;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

.msof-section-title {
  margin: 18px 0 12px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 2px solid #eee;
  padding-bottom: 6px;
}
.msof-section-title:first-child { margin-top: 0; }

.msof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.msof-row { display: flex; flex-direction: column; }
.msof-row-full { grid-column: 1 / -1; }
.msof-row label { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.msof-req { color: #d63638; }

.msof-form input[type="text"],
.msof-form input[type="email"],
.msof-form input[type="tel"],
.msof-form textarea,
.msof-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: #fff;
}
.msof-form textarea { resize: vertical; }

/* Packages */
.msof-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.msof-package {
  position: relative;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fafafa;
}
.msof-package:hover { border-color: #999; }
.msof-package input[type="radio"] { position: absolute; opacity: 0; }
.msof-package input[type="radio"]:checked + .msof-package-body {
  font-weight: 700;
}
.msof-package:has(input[type="radio"]:checked) {
  border-color: #2271b1;
  background: #eaf3fb;
}
.msof-package.has-image { padding: 0; overflow: hidden; }
.msof-package-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  overflow: hidden;
}
.msof-package-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msof-package.has-image .msof-package-body {
  padding: 10px 12px 12px;
}
.msof-package-body { display: flex; flex-direction: column; gap: 4px; }
.msof-package-label { font-size: 14px; font-weight: 600; }
.msof-package-price { font-size: 18px; color: #2271b1; font-weight: 700; }
.msof-strike {
  display: inline-block; margin-left: 6px;
  font-size: 12px; color: #888;
  text-decoration: line-through; font-weight: 400;
}
.msof-free-ship-badge {
  display: inline-block; margin-top: 4px;
  padding: 2px 6px; font-size: 10px; font-weight: 700;
  background: #198754; color: #fff; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.4px;
  align-self: flex-start;
}

/* Payment */
.msof-payments { display: flex; flex-direction: column; gap: 8px; }
.msof-payment.is-disabled {
  opacity: 0.4; cursor: not-allowed;
  background: #f5f5f5; border-color: #ddd;
}
.msof-payment-warning {
  color: #842029;
  font-size: 13px;
  min-height: 18px;
  padding: 2px 0;
}
.msof-payment {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 500;
}
.msof-payment:has(input[type="radio"]:checked) {
  border-color: #2271b1;
  background: #eaf3fb;
}

/* Summary */
.msof-summary {
  margin-top: 16px;
  padding: 14px;
  background: #f5f5f5;
  border-radius: 8px;
}
.msof-summary-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.msof-summary-total {
  font-size: 18px;
  border-top: 1px solid #ccc;
  margin-top: 6px;
  padding-top: 10px;
}

/* Submit */
.msof-submit {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: #2271b1;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.msof-submit:hover:not(:disabled) { background: #135e96; }
.msof-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.msof-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  display: none;
}
.msof-result.is-success { display: block; background: #d1e7dd; color: #0f5132; }
.msof-result.is-error   { display: block; background: #f8d7da; color: #842029; }

/* Thank you */
.msof-thankyou {
  max-width: 520px;
  margin: 1em 0;
  padding: 24px;
  border: 2px solid #2271b1;
  border-radius: 12px;
  background: #eaf3fb;
}
.msof-thankyou h2 { margin-top: 0; }
.msof-thankyou-logo { max-width: 160px; height: auto; margin-bottom: 12px; }
.msof-thankyou-table { width: 100%; border-collapse: collapse; }
.msof-thankyou-table th, .msof-thankyou-table td {
  padding: 6px 8px; text-align: left; border-bottom: 1px solid #cfd8e3;
}

/* ——— Admin ——— */
.msof-filter {
  display: flex; gap: 6px; align-items: center; margin: 8px 0;
}
.msof-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; text-transform: uppercase; font-weight: 600;
  background: #ddd; color: #333;
}
.msof-badge-pending    { background: #ffeeba; color: #856404; }
.msof-badge-paid       { background: #c3e6cb; color: #155724; }
.msof-badge-cod_placed { background: #d4edda; color: #0f5132; }
.msof-badge-processing { background: #bee5eb; color: #0c5460; }
.msof-badge-shipped    { background: #b8daff; color: #004085; }
.msof-badge-delivered  { background: #a5d6a7; color: #1b5e20; }
.msof-badge-failed,
.msof-badge-cancelled  { background: #f5c6cb; color: #721c24; }
.msof-badge-refunded   { background: #e2e3e5; color: #383d41; }

.msof-detail {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px;
}
.msof-detail-side {
  background: #fff; padding: 16px; border: 1px solid #ddd; border-radius: 6px;
}
.msof-log {
  background: #f5f5f5; padding: 12px; border-radius: 6px;
  font-size: 12px; max-height: 240px; overflow: auto;
  white-space: pre-wrap;
}
@media (max-width: 800px) {
  .msof-detail { grid-template-columns: 1fr; }
  .msof-grid   { grid-template-columns: 1fr; }
}
