/*
 * Redesigned checkout / result utilities for application/views/rnp-ui/marketplace/
 * (cart, card_payment, order_success, order_failure, subscription_success, subscription_failure).
 *
 * Restored 2026-09-30 verbatim from web/assets/marketplace/style-new.css (commit 3eecbddc,
 * 2026-08-26). It only ever existed in the never-served web/ copy, so these views rendered
 * without base styles. The views keep their own page-specific <style> overrides.
 *
 * NOTE: --rnp-accent, --rnp-border, --rnp-muted, --rnp-surface, --rnp-text and .rnp-card,
 * .rnp-page are also defined (differently) by assets/rnp-ui/shared.css. These pages do not
 * load shared.css today; reconcile before adopting it (AGENTS.md rnp-ui contract).
 */

/* ============================================================
   RNP Checkout / Result — Shared Utilities
   Used by: order_success, order_failure, cart2, card_payment2
   ============================================================ */

/* Tokens */
:root {
  --rnp-bg:           #f1f3f8;
  --rnp-surface:      #fff;
  --rnp-surface2:     #f8f9fc;
  --rnp-border:       #e4e7ef;
  --rnp-text:         #1a1a2e;
  --rnp-muted:        #9099aa;
  --rnp-secondary:    #5a6070;
  --rnp-accent:       #4f46e5;
  --rnp-accent-hover: #4338ca;
  --rnp-green:        #16a34a;
  --rnp-green-bg:     #f0fdf4;
  --rnp-green-border: #bbf7d0;
  --rnp-red:          #dc2626;
  --rnp-shadow:       0 2px 16px rgba(0,0,0,.07);
  --rnp-radius:       10px;
}

/* Page ground */
.rnp-page {
  background: var(--rnp-bg);
  min-height: 60vh;
  padding: 48px 0 80px;
}

/* Card */
.rnp-card {
  background: var(--rnp-surface);
  border-radius: var(--rnp-radius);
  box-shadow: var(--rnp-shadow);
  padding: 32px;
}

/* Section label */
.rnp-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rnp-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rnp-border);
}

/* Buttons */
.rnp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.rnp-btn-primary {
  background: var(--rnp-accent);
  color: #fff !important;
}
.rnp-btn-primary:hover {
  background: var(--rnp-accent-hover);
  color: #fff !important;
  text-decoration: none;
}
.rnp-btn-full { width: 100%; display: flex; }
.rnp-btn-ghost {
  background: transparent;
  color: var(--rnp-secondary) !important;
  border: 1.5px solid var(--rnp-border);
}
.rnp-btn-ghost:hover {
  border-color: var(--rnp-accent);
  color: var(--rnp-accent) !important;
  text-decoration: none;
}

/* Amount badge */
.rnp-amount-badge {
  display: inline-block;
  background: var(--rnp-green-bg);
  border: 1px solid var(--rnp-green-border);
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 22px;
  font-weight: 700;
  color: #166534;
}

/* Result card (order success / failure) */
.rnp-result-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: var(--rnp-bg);
}
.rnp-result-card {
  background: var(--rnp-surface);
  border-radius: var(--rnp-radius);
  box-shadow: var(--rnp-shadow);
  padding: 56px 48px;
  max-width: 560px;
  width: 100%;
  text-align: center;
}
.rnp-result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}
.rnp-result-icon.success { background: #e8f5e9; color: #2e7d32; }
.rnp-result-icon.fail    { background: #ffeaea; color: #d32f2f; }
.rnp-result-card h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--rnp-text);
  margin: 0 0 12px;
}
.rnp-result-card p {
  font-size: 15px;
  color: var(--rnp-secondary);
  margin: 0 0 8px;
  line-height: 1.6;
}
.rnp-result-card .flash-msg {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  color: #856404;
  margin: 16px 0;
  text-align: left;
}

/* Summary rows */
.rnp-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--rnp-secondary);
  margin-bottom: 11px;
}
.rnp-summary-row.savings { color: var(--rnp-green); }
.rnp-summary-row.total {
  font-size: 17px;
  font-weight: 700;
  color: var(--rnp-text);
  border-top: 1px solid var(--rnp-border);
  padding-top: 14px;
  margin-top: 4px;
  margin-bottom: 0;
}
.rnp-remove-coupon {
  font-size: 11px;
  color: var(--rnp-red);
  text-decoration: none;
  margin-left: 6px;
}
.rnp-remove-coupon:hover { text-decoration: underline; }

/* Secure note */
.rnp-secure-note {
  text-align: center;
  font-size: 11px;
  color: var(--rnp-muted);
  margin-top: 10px;
}

/* Form fields (shared across cart + payment) */
.rnp-form-group { display: flex; flex-direction: column; gap: 5px; }
.rnp-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--rnp-secondary);
}
.rnp-form-group input,
.rnp-form-group select {
  border: 1.5px solid var(--rnp-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--rnp-text);
  background: var(--rnp-surface2);
  transition: border-color .15s;
  font-family: inherit;
}
.rnp-form-group input:focus,
.rnp-form-group select:focus {
  outline: none;
  border-color: var(--rnp-accent);
  background: var(--rnp-surface);
}
.rnp-form-group input::placeholder { color: var(--rnp-muted); }

/* Coupon pill (cart item) */
.rnp-coupon-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--rnp-green-bg);
  border: 1px solid var(--rnp-green-border);
  color: var(--rnp-green);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

/* Divider (payment page "or pay with") */
.rnp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--rnp-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.rnp-divider::before,
.rnp-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rnp-border);
}
