/**
 * MEM Connector — Admin Styles
 *
 * Styles for the MEM Connector settings page in WooCommerce admin.
 *
 * @package Mem_Connector
 * @since   1.0.0
 */

/* ==========================================================================
   Base & Layout
   ========================================================================== */

.mem-wrap {
  max-width: 1200px;
  margin: 0;
  padding: 0;
}

.mem-wrap * {
  box-sizing: border-box;
}

.mem-content {
  margin-top: 20px;
}

/* ==========================================================================
   Hero Header
   ========================================================================== */

.mem-hero {
  background: #3c3c3c;
  border-radius: 10px;
  margin: 20px 0 0;
  overflow: hidden;
  position: relative;
}

.mem-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  pointer-events: none;
}

.mem-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: 20%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 50%;
  pointer-events: none;
}

.mem-hero-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 32px;
  position: relative;
  z-index: 1;
}

.mem-hero-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mem-hero-title {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.mem-wrap > .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mem-wrap > hr.wp-header-end {
  display: none;
}

.mem-hero-text p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ==========================================================================
   Notice
   ========================================================================== */

.mem-notice {
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 8px;
  line-height: 1.5;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.mem-notice.mem-notice-success {
  background: #edfaef;
  border-color: #b8e6be;
  color: #0a5c1a;
}

.mem-notice.mem-notice-error {
  background: #fcf0f1;
  border-color: #f0b8b8;
  color: #8a1f1f;
}

.mem-notice-icon {
  flex-shrink: 0;
}

.mem-notice.mem-notice-success .mem-notice-icon::before {
  content: "\f147";
  font-family: dashicons;
  font-size: 18px;
  color: #00a32a;
}

.mem-notice.mem-notice-error .mem-notice-icon::before {
  content: "\f335";
  font-family: dashicons;
  font-size: 18px;
  color: #d63638;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.mem-section {
  margin-bottom: 24px;
}

/* ==========================================================================
   Two-Column Connect Grid
   ========================================================================== */

.mem-connect-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* ==========================================================================
   Steps Card (outer wrapper)
   ========================================================================== */

.mem-steps-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.mem-steps-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid #f0f0f1;
}

.mem-steps-card-header > .dashicons {
  background: #f0f0f1;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #3c3c3c;
  flex-shrink: 0;
  line-height: 42px;
  text-align: center;
}

.mem-steps-card-header h2 {
  margin: 0 0 4px;
  padding: 0;
  font-size: 1.1em;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.3;
}

.mem-steps-card-header p {
  margin: 0;
  font-size: 13px;
  color: #646970;
  line-height: 1.5;
}

/* ==========================================================================
   Step Items (inside the steps card)
   ========================================================================== */

.mem-steps-list {
  display: flex;
  flex-direction: column;
}

.mem-step-item {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f1;
  transition: background 0.15s ease;
}

.mem-step-item:last-child {
  border-bottom: none;
}

.mem-step-item:hover {
  background: #fafafa;
}

.mem-step-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.mem-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3c3c3c;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.mem-step-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.mem-step-item-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.4;
}

.mem-step-icon {
  color: #a7aaad;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mem-step-item p {
  margin: 0 0 0 40px;
  font-size: 13px;
  color: #646970;
  line-height: 1.55;
}

.mem-step-item p a {
  color: #2271b1;
  text-decoration: none;
  font-weight: 500;
}

.mem-step-item p a:hover {
  text-decoration: underline;
}

/* Step Image / Placeholder
   ---------------------------------------- */

.mem-step-img-wrap {
  margin-top: 12px;
  margin-left: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f7f7;
  border: 1px solid #eee;
}

.mem-step-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* Clickable image — cursor + hover effect */
.mem-step-img-clickable:not(.is-missing) {
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mem-step-img-clickable:not(.is-missing):hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.mem-step-img-clickable:not(.is-missing)::after {
  content: "\f179";
  font-family: dashicons;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mem-step-img-clickable:not(.is-missing) {
  position: relative;
}

.mem-step-img-clickable:not(.is-missing):hover::after {
  opacity: 1;
}

.mem-step-img-wrap .mem-step-img-placeholder {
  display: none;
}

.mem-step-img-wrap.is-missing img {
  display: none;
}

.mem-step-img-wrap.is-missing .mem-step-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 12px;
  border: 2px dashed #dcdcde;
  border-radius: 8px;
  background: #fafafa;
}

.mem-step-img-wrap.is-missing .mem-step-img-placeholder .dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  color: #c3c4c7;
}

.mem-step-img-wrap.is-missing .mem-step-img-placeholder span:last-child {
  color: #a7aaad;
  font-size: 11px;
}

/* ==========================================================================
   Credentials Card
   ========================================================================== */

.mem-credentials-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mem-credentials-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f1;
}

.mem-credentials-header > .dashicons {
  background: #f0f0f1;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #3c3c3c;
  flex-shrink: 0;
  line-height: 42px;
  text-align: center;
}

.mem-credentials-header h2 {
  margin: 0 0 4px;
  font-size: 1.1em;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.3;
}

.mem-credentials-header p {
  margin: 0;
  font-size: 13px;
  color: #646970;
  line-height: 1.5;
}

/* ==========================================================================
   Form
   ========================================================================== */

.mem-credentials-sticky {
  position: sticky;
  top: 42px;
}

.mem-form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.mem-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.mem-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mem-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
}

.mem-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mem-input-wrap:focus-within {
  border-color: #3c3c3c;
  box-shadow: 0 0 0 2px rgba(60, 60, 60, 0.12);
}

.mem-input-wrap .dashicons {
  color: #a7aaad;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 8px;
  transition: color 0.15s ease;
}

.mem-input-wrap:focus-within .dashicons {
  color: #3c3c3c;
}

.mem-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 13.5px;
  color: #1d2327;
  background: transparent !important;
  box-shadow: none !important;
  min-width: 0;
}

.mem-input-wrap input::placeholder {
  color: #a7aaad;
}

/* Override Chrome autofill blue background (#e8f0fe) */
.mem-input-wrap input:-webkit-autofill,
.mem-input-wrap input:-webkit-autofill:hover,
.mem-input-wrap input:-webkit-autofill:focus,
.mem-input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #1d2327 !important;
  background-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s;
}

.mem-form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  font-size: 12px;
  color: #646970;
  line-height: 1.5;
}

.mem-form-hint .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  color: #a7aaad;
}

/* Terms & Privacy checkbox */
.mem-terms-check {
  margin: 0 0 20px;
}

.mem-terms-check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #1d2327;
  line-height: 1.5;
  cursor: pointer;
}

.mem-terms-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: #3c3c3c;
  cursor: pointer;
}

.mem-terms-check a {
  color: #2271b1;
  text-decoration: none;
  font-weight: 500;
}

.mem-terms-check a:hover {
  text-decoration: underline;
}

.mem-terms-check.mem-terms-error label {
  color: #d63638;
}

.mem-terms-check.mem-terms-error input[type="checkbox"] {
  outline: 2px solid #d63638;
  outline-offset: 1px;
  border-radius: 3px;
}

.mem-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mem-connect-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.mem-connect-actions-stack .mem-btn {
  text-align: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.mem-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  line-height: 1;
}

.mem-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.mem-btn-primary {
  background: #3c3c3c;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  width: 100%;
  justify-content: center;
}

a.mem-btn-primary {
  color: #fff;
  text-decoration: none;
}

.mem-btn-primary:hover {
  background: #2a2a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

a.mem-btn-primary:hover {
  color: #fff;
}

.mem-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mem-btn-secondary {
  background: #fff;
  color: #3c3c3c;
  border: 1px solid #c3c4c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  justify-content: center;
}

.mem-btn-secondary:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.mem-btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mem-btn-secondary .mem-spinner {
  border: 2px solid rgba(60, 60, 60, 0.15);
  border-top-color: #3c3c3c;
}

.mem-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.mem-btn-danger-outline {
  background: transparent;
  color: #d63638;
  border: 1px solid #e0b8b8;
  padding: 10px 20px;
  font-size: 13px;
}

.mem-btn-danger-outline:hover {
  background: #fcf0f1;
  border-color: #d63638;
}

.mem-btn-danger-outline:active {
  background: #f8dada;
}

/* Spinner inside buttons */
.mem-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mem-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

.mem-btn-danger-outline .mem-spinner {
  border: 2px solid rgba(214, 54, 56, 0.2);
  border-top-color: #d63638;
}

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

/* ==========================================================================
   Connected State
   ========================================================================== */

.mem-connected-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mem-connected-header {
  padding: 28px 28px 24px;
  border-bottom: 1px solid #f0f0f1;
}

.mem-connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #edfaef;
  border: 1px solid #b8e6be;
  border-radius: 20px;
  padding: 5px 14px 5px 10px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #0a5c1a;
}

.mem-pulse {
  width: 8px;
  height: 8px;
  background: #00a32a;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.mem-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(0, 163, 42, 0.3);
  border-radius: 50%;
  animation: mem-pulse-ring 2s ease-in-out infinite;
}

@keyframes mem-pulse-ring {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.mem-connected-header h2 {
  margin: 0 0 6px;
  font-size: 1.25em;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.3;
}

.mem-connected-header p {
  margin: 0;
  font-size: 13px;
  color: #646970;
  line-height: 1.5;
}

/* Info Grid
   ---------------------------------------- */

.mem-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.mem-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid #f0f0f1;
  transition: background 0.15s ease;
}

.mem-info-item:hover {
  background: #fafafa;
}

.mem-info-item:nth-child(odd) {
  border-right: 1px solid #f0f0f1;
}

.mem-info-item:nth-last-child(-n + 2) {
  border-bottom: none;
}

.mem-info-icon {
  background: #f0f0f1;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #50575e;
  flex-shrink: 0;
  line-height: 36px;
  text-align: center;
}

.mem-info-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mem-info-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #646970;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mem-info-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.4;
  word-break: break-all;
}

.mem-info-value code {
  background: #f0f0f1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #1d2327;
}

.mem-info-sub {
  font-weight: 400;
  color: #646970;
  font-size: 12px;
}

/* Connected Footer
   ---------------------------------------- */

.mem-connected-footer {
  padding: 20px 28px;
  border-top: 1px solid #f0f0f1;
  background: #fafafa;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.mem-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: mem-lightbox-in 0.2s ease;
}

@keyframes mem-lightbox-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mem-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.mem-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  background: #fff;
  animation: mem-lightbox-zoom 0.25s ease;
}

@keyframes mem-lightbox-zoom {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.mem-lightbox-content img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.mem-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 2;
  padding: 0;
}

.mem-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.85);
}

.mem-lightbox-close .dashicons {
  font-size: 22px;
  width: 22px;
  height: 22px;
  color: #fff;
}

/* ==========================================================================
   Order Meta Box: Fulfillment Details
   ========================================================================== */

.mem-fulfillment-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: #646970;
  font-size: 13px;
  line-height: 1.5;
}

.mem-fulfillment-empty .dashicons {
  color: #a7aaad;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mem-fulfillment-empty p {
  margin: 0;
}

.mem-fulfillment-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.mem-fulfillment-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mem-fulfillment-label {
  font-size: 11px;
  font-weight: 600;
  color: #646970;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mem-fulfillment-value {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.4;
}

.mem-fulfillment-code {
  display: inline-block;
  background: #f0f0f1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: Consolas, Monaco, monospace;
  word-break: break-all;
}

.mem-fulfillment-track-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #3c3c3c;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
  margin-top: 2px;
}

.mem-fulfillment-track-link:hover {
  background: #2a2a2a;
  color: #fff;
}

.mem-fulfillment-track-link:focus {
  color: #fff;
  outline: 2px solid #3c3c3c;
  outline-offset: 2px;
}

.mem-fulfillment-track-link .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Live Preview Settings Form
   ========================================================================== */

.mem-settings-section {
  border-bottom: 1px solid #f0f0f1;
}

.mem-settings-section:last-of-type {
  border-bottom: none;
}

.mem-settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 11.5px;
  font-weight: 600;
  color: #50575e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f1;
  margin: 0;
}

.mem-settings-section-title .dashicons {
  font-size: 15px;
  width: 15px;
  height: 15px;
  color: #a7aaad;
}

.mem-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid #f8f8f8;
  transition: background 0.12s ease;
}

.mem-settings-row:last-child {
  border-bottom: none;
}

.mem-settings-row:hover {
  background: #fdfdfd;
}

.mem-settings-row-label {
  flex: 1;
  min-width: 0;
}

.mem-settings-row-label > label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 3px !important;
  cursor: default;
  float: none;
  width: auto;
}

.mem-settings-row-label > p {
  margin: 0;
  font-size: 12.5px;
  color: #646970;
  line-height: 1.5;
}

.mem-settings-row-control {
  flex-shrink: 0;
  width: 240px;
}

/* Inline control (number + unit) */
.mem-settings-row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mem-unit {
  font-size: 13px;
  color: #646970;
  flex-shrink: 0;
}

/* Text / Number inputs — override WP admin */
.mem-wrap .mem-lp-input {
  width: 100% !important;
  height: 36px !important;
  min-height: 0 !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  border: 1px solid #c3c4c7 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  background: #fff !important;
  color: #1d2327 !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}

.mem-wrap .mem-lp-input:focus {
  border-color: #3c3c3c !important;
  box-shadow: 0 0 0 2px rgba(60, 60, 60, 0.12) !important;
}

.mem-wrap .mem-lp-input-narrow {
  width: 80px !important;
}

.mem-wrap .mem-lp-input-readonly {
  background: #f6f7f7 !important;
  color: #646970 !important;
  cursor: not-allowed !important;
  border-color: #dcdcde !important;
  box-shadow: none !important;
}

/* Select — override WP admin */
.mem-wrap .mem-select {
  width: 100% !important;
  height: 36px !important;
  min-height: 0 !important;
  padding: 6px 28px 6px 10px !important;
  font-size: 13px !important;
  border: 1px solid #c3c4c7 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  outline: none !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646970' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  color: #1d2327 !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}

.mem-wrap .mem-select:focus {
  border-color: #3c3c3c !important;
  box-shadow: 0 0 0 2px rgba(60, 60, 60, 0.12) !important;
}

/* Toggle Switch — override WP admin checkbox styles */
.mem-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  line-height: 1;
}

.mem-wrap .mem-toggle input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

.mem-toggle-track {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #c3c4c7;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.mem-wrap .mem-toggle input:checked + .mem-toggle-track {
  background: #3c3c3c;
}

.mem-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease;
  pointer-events: none;
}

.mem-wrap .mem-toggle input:checked + .mem-toggle-track .mem-toggle-thumb {
  left: 23px;
}

/* Color controls — override WP admin */
.mem-color-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.mem-color-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.mem-color-field > label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #646970 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 !important;
  cursor: default;
  float: none !important;
  width: auto !important;
}

.mem-wrap .mem-color-field input[type="color"] {
  width: 52px !important;
  height: 36px !important;
  min-height: 0 !important;
  border: 1px solid #c3c4c7 !important;
  border-radius: 8px !important;
  cursor: pointer;
  padding: 3px !important;
  background: #fff !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease;
}

.mem-wrap .mem-color-field input[type="color"]:hover {
  border-color: #8c8f94 !important;
  outline: none !important;
}

/* Form Footer */
.mem-lp-form-footer {
  padding: 20px 28px;
  background: #fafafa;
  border-top: 1px solid #f0f0f1;
}

.mem-lp-form-footer .button-primary {
  height: auto;
  padding: 8px 22px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 6px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Collapse two-column grid when the admin content area is narrow */
@media screen and (max-width: 960px) {
  .mem-connect-grid {
    grid-template-columns: 1fr;
  }

  .mem-credentials-sticky {
    position: static;
  }
}

@media screen and (max-width: 782px) {
  .mem-wrap {
    max-width: 100%;
  }

  .mem-hero-inner {
    padding: 22px 20px;
    gap: 14px;
  }

  .mem-hero-logo {
    width: 44px;
    height: 44px;
  }

  .mem-hero-text h1 {
    font-size: 1.25em;
  }

  .mem-form-row {
    grid-template-columns: 1fr;
  }

  .mem-credentials-card {
    padding: 20px;
  }

  .mem-credentials-header {
    flex-direction: column;
    gap: 10px;
  }

  .mem-info-grid {
    grid-template-columns: 1fr;
  }

  .mem-info-item:nth-child(odd) {
    border-right: none;
  }

  .mem-info-item:nth-last-child(2) {
    border-bottom: 1px solid #f0f0f1;
  }

  .mem-info-item {
    padding: 16px 20px;
  }

  .mem-connected-header {
    padding: 20px;
  }

  .mem-connected-footer {
    padding: 16px 20px;
  }

  .mem-steps-card-header {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }

  .mem-step-item {
    padding: 16px 20px;
  }

  .mem-step-item p,
  .mem-step-img-wrap {
    margin-left: 0;
  }

  /* Live Preview Settings — stack rows on mobile */
  .mem-settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
  }

  .mem-settings-row-control {
    width: 100%;
  }

  .mem-wrap .mem-lp-input,
  .mem-wrap .mem-select {
    width: 100% !important;
  }

  .mem-settings-section-title {
    padding: 12px 20px;
  }

  .mem-lp-form-footer {
    padding: 16px 20px;
  }
}

@media screen and (max-width: 480px) {
  .mem-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 16px;
  }

  .mem-step-item {
    padding: 14px 16px;
  }

  .mem-btn-primary {
    width: 100%;
    justify-content: center;
  }
}
