/* ========================================
   WC Check Gateway — Frontend Styles v2
   No font-family override — uses theme default
   Full RTL
   ======================================== */

/* ─── CSS Variables ─────────────────────── */
.wcchek-section,
.wck-form,
.wck-cards,
.wck-alert {
  --wck-blue: #2563eb;
  --wck-blue-lt: #eff6ff;
  --wck-green: #16a34a;
  --wck-green-lt: #f0fdf4;
  --wck-red: #dc2626;
  --wck-red-lt: #fef2f2;
  --wck-amber: #d97706;
  --wck-amber-lt: #fffbeb;
  --wck-purple: #7c3aed;
  --wck-gray: #6b7280;
  --wck-border: #e5e7eb;
  --wck-radius: 10px;
  --wck-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ─── Section wrapper ────────────────────── */
.wcchek-section {
  direction: rtl;
  text-align: right;
  margin: 32px 0;
  border: 1px solid var(--wck-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--wck-shadow);
  background: #fff;
}

.wcchek-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}

.wcchek-section-icon {
  font-size: 1.1rem;
}

.wcchek-notice {
  background: #eff6ff;
  border-right: 3px solid #2563eb;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #1e40af;
  margin: 16px 16px 0;
  border-radius: 0 6px 6px 0;
}

/* ─── Alert ──────────────────────────────── */
.wck-alert {
  direction: rtl;
  text-align: right;
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px;
  font-size: 0.9rem;
  font-weight: 600;
}
.wck-alert--error {
  background: var(--wck-red-lt);
  color: var(--wck-red);
  border: 1px solid #fca5a5;
}

/* ─── Status Cards ───────────────────────── */
.wck-cards {
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.wck-card {
  border: 1px solid var(--wck-border);
  border-radius: var(--wck-radius);
  padding: 16px;
  position: relative;
  background: #fafafa;
  transition: box-shadow 0.15s;
}
.wck-card:hover {
  box-shadow: var(--wck-shadow);
}

.wck-card-num {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--wck-gray);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.wck-card-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  margin-bottom: 12px;
}
.wck-card-amount small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--wck-gray);
}

.wck-card-info {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 0.8rem;
}
.wck-card-info dt {
  color: var(--wck-gray);
  white-space: nowrap;
}
.wck-card-info dd {
  color: #111827;
  margin: 0;
  word-break: break-all;
}

/* Status badge on card */
.wck-card-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.wck-badge--pending {
  background: var(--wck-amber-lt);
  color: var(--wck-amber);
}
.wck-badge--uploaded {
  background: var(--wck-blue-lt);
  color: var(--wck-blue);
}
.wck-badge--approved {
  background: var(--wck-green-lt);
  color: var(--wck-green);
}
.wck-badge--bounced {
  background: var(--wck-red-lt);
  color: var(--wck-red);
}
.wck-badge--cleared {
  background: #f5f3ff;
  color: var(--wck-purple);
}
.wck-badge--archived {
  background: #f3f4f6;
  color: #374151;
}

/* ─── Upload Form ────────────────────────── */
.wck-form {
  direction: rtl;
  text-align: right;
}

.wck-steps {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wck-step {
  border: 1.5px solid var(--wck-border);
  border-radius: var(--wck-radius);
  background: #fff;
  transition:
    border-color 0.15s,
    background 0.2s;
}
.wck-step--done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.wck-step--bounced {
  border-color: #fca5a5;
  background: #fff7f7;
}

.wck-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border-bottom: 1px solid transparent;
  cursor: default;
  border-radius: var(--wck-radius);
  transition: background 0.15s;
}
.wck-step--open .wck-step-head,
.wck-step-head[role="button"] {
  cursor: pointer;
}
.wck-step--open .wck-step-head {
  border-bottom-color: var(--wck-border);
  border-radius: var(--wck-radius) var(--wck-radius) 0 0;
}
.wck-step--done .wck-step-head {
  background: #f0fdf4;
  border-radius: var(--wck-radius);
}
.wck-step--bounced .wck-step-head {
  background: #fff1f2;
}
.wck-step--bounced .wck-step-num {
  background: var(--wck-red);
}
.wck-step--done.wck-step-body-visible .wck-step-head {
  border-radius: var(--wck-radius) var(--wck-radius) 0 0;
}
.wck-step-head[role="button"]:hover {
  background: #eff6ff;
}

.wck-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--wck-blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wck-step--done .wck-step-num {
  background: var(--wck-green);
}

.wck-step-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
}
.wck-step-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--wck-gray);
  font-size: 0.82rem;
  margin-right: 6px;
}

.wck-step-done-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wck-green);
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 20px;
}
.wck-step-bounced-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wck-red);
  background: #fee2e2;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ─── Bounce re-upload notice ────────────── */
.wck-bounce-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff1f2;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  direction: rtl;
  text-align: right;
}
.wck-bounce-notice__icon { font-size: 1.2rem; flex-shrink: 0; padding-top: 1px; }
.wck-bounce-notice__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wck-bounce-notice__text strong {
  font-size: .85rem;
  color: #991b1b;
  font-weight: 700;
}
.wck-bounce-notice__text span {
  font-size: .8rem;
  color: #7f1d1d;
}

.wck-step-chevron {
  font-size: 1.2rem;
  color: var(--wck-gray);
  transition: transform 0.2s;
  line-height: 1;
  margin-right: auto; /* push to left edge in RTL */
  margin-left: 0;
}
.wck-step--open .wck-step-chevron {
  transform: rotate(-90deg);
}

.wck-step-body {
  padding: 12px 14px;
}

/* ─── Form Fields Grid ───────────────────── */
.wck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
/* Compact: 3-col on wider screens */
.wck-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.wck-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wck-field-full {
  grid-column: 1 / -1;
}

.wck-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
}
.wck-req-star {
  color: #ef4444;
  margin-right: 2px;
}

.wck-field input[type="text"],
.wck-field input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1.5px solid var(--wck-border);
  border-radius: 7px;
  font-size: 0.82rem;
  text-align: right;
  direction: rtl;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  color: inherit;
}
.wck-field input:focus {
  border-color: var(--wck-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Datepicker wrapper */
.wck-dp-wrap {
  position: relative;
}
.wck-dp-wrap input {
  padding-left: 36px;
  cursor: pointer;
}
.wck-dp-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.wck-dp-icon--locked {
  cursor: default;
  opacity: .6;
}

/* Locked due_date field */
.wck-datepicker--locked {
  background: #f3f4f6 !important;
  color: #374151 !important;
  cursor: default !important;
  border-color: #d1d5db !important;
  pointer-events: none;
}
.wck-dp-wrap:has(.wck-datepicker--locked) input {
  padding-left: 36px;
  cursor: default;
}

/* Global Calendar (appended to body) */
#wck-global-cal {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  padding: 14px;
  min-width: 260px;
  direction: rtl;
}

.wck-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wck-cal-nav {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  transition: background 0.1s;
}
.wck-cal-nav:hover {
  background: #eff6ff;
  color: #2563eb;
}
.wck-cal-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f2937;
}
.wck-cal-table {
  width: 100%;
  border-collapse: collapse;
}
.wck-cal-table th {
  font-size: 0.68rem;
  color: #9ca3af;
  text-align: center;
  padding: 4px 0;
  font-weight: 600;
}
.wck-cal-table td {
  text-align: center;
  padding: 2px;
}
.wck-cal-day {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  color: #1f2937;
  transition:
    background 0.1s,
    color 0.1s;
}
.wck-cal-day:hover {
  background: #eff6ff;
  color: #2563eb;
}
.wck-cal-today {
  font-weight: 700;
  color: #2563eb;
}
.wck-cal-selected {
  background: #2563eb !important;
  color: #fff !important;
  font-weight: 700;
}

/* ─── File Upload ────────────────────────── */
.wck-file-wrap {
  position: relative;
}
.wck-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}
.wck-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 2px dashed var(--wck-border);
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  min-height: 38px;
}
.wck-file-wrap:hover .wck-file-label,
.wck-file-input:focus + .wck-file-label {
  border-color: var(--wck-blue);
  background: var(--wck-blue-lt);
}
.wck-file-icon {
  font-size: 1rem;
}
.wck-file-text {
  font-size: 0.75rem;
  color: var(--wck-gray);
}

/* ─── Step Footer (per-step submit) ─────────── */
.wck-step-footer {
  padding: 10px 0 0;
  margin-top: 10px;
  border-top: 1px solid var(--wck-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-direction: row-reverse;
}

/* Locked step row */
.wck-step-locked {
  background: #f0fdf4;
  border-radius: 0 0 var(--wck-radius) var(--wck-radius);
}
.wck-locked-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 10px 14px;
  align-items: center;
  font-size: 0.82rem;
  color: #374151;
}
.wck-locked-row em {
  color: var(--wck-gray);
  font-style: normal;
}
.wck-locked-row strong {
  color: #1f2937;
}

/* Success inline message */
.wck-step-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #16a34a;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── Footer / Submit (legacy) ────────────── */
.wck-footer {
  padding: 16px;
  border-top: 1px solid var(--wck-border);
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.wck-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  background: var(--wck-blue);
  color: #fff !important;
  border: none;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  text-decoration: none !important;
}
.wck-btn-submit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.wck-btn-submit:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.wck-msg {
  padding: 11px 16px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}
.wck-msg--success {
  background: var(--wck-green-lt);
  color: var(--wck-green);
  border: 1px solid #bbf7d0;
}
.wck-msg--error {
  background: var(--wck-red-lt);
  color: var(--wck-red);
  border: 1px solid #fca5a5;
}

/* Per-step inline message */
.wck-step-msg {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1;
  display: none;
}

/* ─── Checkout gateway info box ──────────── */
.wcchek-checkout-info {
  direction: rtl;
  text-align: right;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 0.875rem;
}
.wcchek-checkout-info p {
  margin: 5px 0;
  color: #1e40af;
}
.wcchek-fee-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 10px;
  color: #92400e;
  font-weight: 600;
}
.wcchek-installments-notice {
  font-weight: 700;
  color: #1e40af;
}
.wcchek-percent-list {
  margin: 4px 0 6px;
  padding-right: 16px;
}
.wcchek-percent-list li {
  font-size: 0.82rem;
  color: #374151;
}
.wcchek-percent-list li strong {
  color: #1e40af;
}
.wcchek-confirm-notice {
  font-size: 0.75rem;
  color: #6b7280;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed #ddd;
}
button.wck-btn-submit {
  background: green;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
}
/* ─── Thank-you CTA button ───────────────── */
.wcchek-thankyou-cta {
  direction: rtl;
  text-align: right;
  margin: 24px 0 8px;
}
.wcchek-thankyou-cta__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.wcchek-thankyou-cta__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.wcchek-thankyou-cta__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wcchek-thankyou-cta__text strong {
  font-size: 0.95rem;
  color: #1e3a8a;
  font-weight: 700;
}
.wcchek-thankyou-cta__text span {
  font-size: 0.82rem;
  color: #3b82f6;
}
.wcchek-thankyou-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #fff !important;
  text-decoration: none !important;
  padding: 11px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    background 0.15s,
    transform 0.1s;
  flex-shrink: 0;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}
.wcchek-thankyou-cta__btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.wcchek-thankyou-cta__arrow {
  font-size: 1.1rem;
  line-height: 1;
}
@media (min-width: 480px) {
  .wcchek-thankyou-cta__btn {
    width: auto;
  }
}

/* Thankyou / Account Section */
.wcchek-thankyou-section,
.wcchek-account-section {
  margin: 30px 0;
  direction: rtl;
}

.wcchek-thankyou-section h2,
.wcchek-account-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--wcchek-primary);
  display: inline-block;
}

.wcchek-instructions {
  background: #f0f9ff;
  border-right: 3px solid var(--wcchek-primary);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 20px;
}

/* Upload Form */
.wcchek-upload-form {
  background: #fff;
  border: 1px solid var(--wcchek-border);
  border-radius: var(--wcchek-radius);
  overflow: hidden;
  box-shadow: var(--wcchek-shadow);
}

.wcchek-installment-block {
  padding: 20px;
  border-bottom: 1px solid var(--wcchek-border);
}

.wcchek-installment-block:last-of-type {
  border-bottom: none;
}

.wcchek-installment-block h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wcchek-primary);
  margin: 0 0 16px 0;
  padding: 8px 14px;
  background: #f0f6ff;
  border-radius: 6px;
}

.wcchek-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.wcchek-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wcchek-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.wcchek-field input,
.wcchek-field select {
  border: 1px solid var(--wcchek-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.wcchek-field input:focus {
  border-color: var(--wcchek-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 130, 235, 0.15);
}

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

.wcchek-submitted-notice {
  background: #dcfce7;
  color: #166534;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

.wcchek-submit-wrap {
  padding: 18px 20px;
  border-top: 1px solid var(--wcchek-border);
  background: var(--wcchek-light);
}

.wcchek-submit-btn {
  background: var(--wcchek-primary) !important;
  color: #fff !important;
  border: none !important;
  padding: 10px 28px !important;
  border-radius: 8px !important;
  font-size: 0.95rem !important;
  cursor: pointer;
  transition: background 0.15s !important;
}

.wcchek-submit-btn:hover {
  background: #3565d4 !important;
}

/* Status Table */
.wcchek-status-view {
  overflow-x: auto;
}

.wcchek-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: #fff;
  border-radius: var(--wcchek-radius);
  overflow: hidden;
  box-shadow: var(--wcchek-shadow);
}

.wcchek-table th,
.wcchek-table td {
  padding: 10px 14px;
  border: 1px solid var(--wcchek-border);
  text-align: right;
}

.wcchek-table thead th {
  background: var(--wcchek-light);
  font-weight: 600;
  color: #374151;
}

.wcchek-table tbody tr:hover {
  background: #f0f6ff;
}

/* Badges */
.wcchek-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.wcchek-badge--pending {
  background: #fef3c7;
  color: #92400e;
}
.wcchek-badge--uploaded {
  background: #dbeafe;
  color: #1e40af;
}
.wcchek-badge--approved {
  background: #dcfce7;
  color: #166534;
}
.wcchek-badge--bounced {
  background: #fee2e2;
  color: #991b1b;
}
.wcchek-badge--cleared {
  background: #ede9fe;
  color: #5b21b6;
}
.wcchek-badge--archived {
  background: #f3f4f6;
  color: #374151;
}

/* Error */
.wcchek-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Messages */
.wcchek-msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 0.9rem;
}
.wcchek-msg--success {
  background: #dcfce7;
  color: #166534;
}
.wcchek-msg--error {
  background: #fee2e2;
  color: #991b1b;
}
.wcchek-msg--loading {
  background: #dbeafe;
  color: #1e40af;
}
