/* ==========================================================================
   RumhoPay — 100% Paymently Clean Split-Layout Design
   Pixel-Perfect to mathbariashop.paymently.io
   ========================================================================== */

:root {
  --bg-canvas: #f4f6fa;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #2563eb;
  
  --primary: #2563eb;          /* Paymently Royal Blue */
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;

  --rose: #e11d48;
  --rose-bg: #fff1f2;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 20px 45px -12px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: -0.01em;
}

.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.text-primary { color: var(--primary) !important; }
.text-emerald { color: var(--emerald) !important; }
.text-rose { color: var(--rose) !important; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Main Wrapper */
.paymently-wrapper {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  transition: max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.paymently-wrapper.step2-active {
  max-width: 440px;
}

.paymently-wrapper.step2-active .payment-action-panel {
  padding: 24px 22px;
}

.paymently-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   2-Column Split Layout
   ========================================================================== */

.checkout-layout {
  display: flex;
  min-height: 480px;
}

/* LEFT COLUMN: Order Summary */
.order-summary-panel {
  flex: 0 0 350px;
  width: 350px;
  padding: 30px 24px 24px;
  display: flex;
  flex-direction: column;
}

.merchant-profile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.merchant-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ea580c;
  flex-shrink: 0;
  overflow: hidden;
}

.merchant-custom-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.mini-custom-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
}

.merchant-bag-icon {
  width: 22px;
  height: 22px;
}

.merchant-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.merchant-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.trx-id-line {
  font-size: 0.74rem;
  color: var(--text-light);
  word-break: break-all;
}

.timer-line {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.timer-line span {
  color: var(--primary);
}

.amount-badge-top {
  text-align: right;
  flex-shrink: 0;
}

.currency-amt {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.panel-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 18px 0;
}

/* Price Breakdown */
.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.price-label {
  color: var(--text-sub);
}

.price-val {
  color: var(--text-main);
  font-weight: 600;
}

.price-row.total-row {
  font-size: 0.95rem;
}

.price-row.total-row .price-label,
.price-row.total-row .price-val {
  font-weight: 800;
  color: var(--text-main);
}

/* Customer Info */
.customer-info-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.info-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.customer-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  gap: 10px;
}

.data-label {
  color: var(--text-muted);
}

.data-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

/* Left Bottom Links */
.summary-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-link-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-link-item:hover {
  color: var(--primary);
}

.footer-link-item svg {
  width: 15px;
  height: 15px;
}

/* Vertical Divider */
.vertical-divider {
  width: 1px;
  background-color: var(--border-color);
  flex-shrink: 0;
}

/* ==========================================================================
   RIGHT COLUMN: Payment Action Panel
   ========================================================================== */

.payment-action-panel {
  flex: 1;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.step-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.action-panel-header {
  margin-bottom: 16px;
}

.action-panel-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Category Pills */
.category-pills-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

.category-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.category-pill svg {
  width: 14px;
  height: 14px;
}

/* Methods Selection Grid */
.methods-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.paymently-method-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  min-height: 85px;
}

.paymently-method-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.paymently-method-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #ffffff;
}

.paymently-method-card.active .method-title-text {
  color: var(--primary);
}

.method-logo-wrap {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-svg {
  height: 36px;
  width: auto;
  max-width: 90px;
}

.method-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.15s;
}

/* Primary Big Blue Action Button */
.btn-primary-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  width: 100%;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-action:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-primary-action:active {
  transform: scale(0.99);
}

/* Cancel Link */
.cancel-link-wrap {
  text-align: center;
  margin-top: 14px;
}

.cancel-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.15s;
}

.cancel-link:hover {
  color: var(--text-main);
}

/* ==========================================================================
   STEP 2: Instruction & TrxID Input Screen (Screenshot 2)
   ========================================================================== */

.step2-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.btn-step-back {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-step-back:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-step-back svg {
  width: 16px;
  height: 16px;
}

.step2-merchant-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step2-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ea580c;
}

.mini-bag-icon {
  width: 15px;
  height: 15px;
}

.sub-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.merchant-name-inline {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.step2-amount-meta {
  text-align: right;
  flex-shrink: 0;
}

.step2-amount-meta strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

/* Provider Banner Bar */
.provider-banner-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.provider-logo-slot .brand-svg {
  height: 28px;
}

.provider-title-slot {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Clean Instruction Callout Box */
.instruction-callout-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.86rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 16px;
}

.instruction-callout-box strong {
  font-weight: 700;
}

/* 2 Clean White Copy Cards */
.copy-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.paymently-copy-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-card-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.copy-card-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-card-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-paymently-copy {
  background: #ffffff;
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 5px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-paymently-copy:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-paymently-copy.copied {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

/* TrxID Submission Form */
.trx-form-paymently {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label-paymently {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.input-paymently {
  width: 100%;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  background: #ffffff;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.input-paymently:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.input-paymently::placeholder {
  color: var(--text-light);
  font-weight: 500;
  text-transform: none;
}

/* Status Alert */
.status-alert {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-alert.error {
  background-color: var(--rose-bg);
  border: 1px solid var(--rose);
  color: var(--rose);
}

.status-alert.pending {
  background-color: var(--amber-light);
  border: 1px solid var(--amber);
  color: var(--amber);
}

.status-alert.success {
  background-color: var(--emerald-bg);
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

/* Spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* State Cards (Loading / Error) */
.state-card {
  text-align: center;
  padding: 4rem 1.5rem;
}

.minimal-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

.state-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.state-icon-wrap.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--rose-bg);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.state-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.btn-secondary {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 18px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Success Overlay State
   ========================================================================== */

.success-overlay {
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.success-modal {
  width: 100%;
  max-width: 380px;
}

.success-checkmark-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
}

.checkmark-svg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  stroke-width: 3;
  stroke: var(--emerald);
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 var(--emerald);
  animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--emerald);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: #ffffff;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.08, 1.08, 1); }
}

@keyframes fill {
  100% { box-shadow: inset 0 0 0 32px var(--emerald); }
}

.success-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.success-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.receipt-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
}

.receipt-label {
  color: var(--text-muted);
}

.receipt-val {
  color: var(--text-main);
  font-weight: 700;
}

.status-pill-success {
  background-color: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.redirect-progress-bar {
  width: 100%;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  animation: progressFill 2.5s linear forwards;
}

@keyframes progressFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

.redirect-hint {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ==========================================================================
   Mobile Responsive Breakpoint (< 768px)
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .paymently-wrapper {
    max-width: 460px;
  }

  .paymently-card {
    border-radius: var(--radius-lg);
  }

  .checkout-layout {
    flex-direction: column;
  }

  .vertical-divider {
    width: 100%;
    height: 1px;
  }

  .order-summary-panel {
    width: 100%;
    flex: none;
    padding: 20px 18px 16px;
  }

  .summary-footer {
    padding-top: 14px;
  }

  .payment-action-panel {
    padding: 20px 18px;
  }

  .methods-selection-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .paymently-method-card {
    padding: 10px 8px;
    min-height: 75px;
  }

  .brand-svg {
    height: 30px;
  }

  .copy-card-value {
    font-size: 1.05rem;
  }
}
