/* =====================================================================
   RHCES Payment Pages – Checkout, Status & Download Styles
   Matches the main RHCES dark navy/cyan theme
   ===================================================================== */

/* ── Payment Page Base ─────────────────────────────────────────────── */
.pay-page {
  min-height: 100vh;
  background: var(--grad-hero);
  display: flex;
  flex-direction: column;
}

.pay-page .navbar { position: relative; }

.pay-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.pay-container {
  width: 100%;
  max-width: 560px;
}

/* ── Card ──────────────────────────────────────────────────────────── */
.pay-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.pay-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-accent);
}

/* ── Header ────────────────────────────────────────────────────────── */
.pay-header {
  text-align: center;
  margin-bottom: 32px;
}

.pay-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  text-decoration: none;
}

.pay-logo img {
  width: 32px;
  height: 32px;
}

.pay-logo span {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pay-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.pay-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Product Info ──────────────────────────────────────────────────── */
.pay-product {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
}

.pay-product-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.pay-product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.pay-product-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pay-currency {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pay-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pay-per-month {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
  align-self: flex-end;
  padding-bottom: 4px;
}

/* ── Form ──────────────────────────────────────────────────────────── */
.pay-form {
  margin-bottom: 24px;
}

.pay-field {
  margin-bottom: 16px;
}

.pay-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.pay-field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--t-base), background var(--t-base);
  outline: none;
}

.pay-field input:focus {
  border-color: var(--cyan-bright);
  background: rgba(0, 212, 255, 0.05);
}

.pay-field input::placeholder {
  color: var(--text-dim);
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.pay-method-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #007bff, #0056d2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.65rem;
  color: white;
  letter-spacing: -0.02em;
}

.pay-method-info {
  flex: 1;
}

.pay-method-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
}

.pay-method-tag {
  font-size: 0.75rem;
  color: var(--cyan-bright);
}

.pay-method-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-method-check svg {
  width: 12px;
  height: 12px;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.pay-btn-primary {
  background: var(--grad-accent);
  color: var(--white);
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.3);
}

.pay-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(0, 212, 255, 0.45);
}

.pay-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pay-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.pay-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
}

.pay-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--white);
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.3);
}

.pay-btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(16, 185, 129, 0.45);
}

/* ── Spinner ───────────────────────────────────────────────────────── */
.pay-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: paySpin 0.6s linear infinite;
}

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

/* ── Status Page ───────────────────────────────────────────────────── */
.pay-status-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-status-icon.pending {
  background: rgba(251, 191, 36, 0.1);
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.pay-status-icon.pending svg { color: var(--gold-400); }

.pay-status-icon.processing {
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid rgba(0, 212, 255, 0.3);
  animation: statusPulse 2s ease infinite;
}

.pay-status-icon.processing svg { color: var(--cyan-bright); }

.pay-status-icon.paid {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.3);
}

.pay-status-icon.paid svg { color: #10b981; }

.pay-status-icon.expired,
.pay-status-icon.failed {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.pay-status-icon.expired svg,
.pay-status-icon.failed svg { color: #ef4444; }

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.2); }
  50% { box-shadow: 0 0 0 12px rgba(0, 212, 255, 0); }
}

/* ── Order Details ─────────────────────────────────────────────────── */
.pay-details {
  margin: 24px 0;
}

.pay-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pay-detail-row:last-child {
  border-bottom: none;
}

.pay-detail-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pay-detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pay-detail-value.amount {
  font-family: var(--font-display);
  font-size: 1rem;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Status Badge ──────────────────────────────────────────────────── */
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pay-badge.pending {
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold-400);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.pay-badge.processing {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan-bright);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.pay-badge.paid {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pay-badge.expired {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pay-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Timer ─────────────────────────────────────────────────────────── */
.pay-timer {
  text-align: center;
  margin: 20px 0;
}

.pay-timer-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pay-timer-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
}

.pay-timer-value.warning { color: var(--gold-400); }
.pay-timer-value.danger { color: #ef4444; }

/* ── Progress Bar ──────────────────────────────────────────────────── */
.pay-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  margin: 16px 0;
}

.pay-progress-fill {
  height: 100%;
  background: var(--grad-accent);
  border-radius: 99px;
  transition: width 1s ease;
}

/* ── Download Section ──────────────────────────────────────────────── */
.pay-download-section {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pay-download-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ── Messages ──────────────────────────────────────────────────────── */
.pay-message {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pay-message.info {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: var(--cyan-bright);
}

.pay-message.success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.pay-message.warning {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  color: var(--gold-400);
}

.pay-message.error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.pay-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.pay-footer a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--t-base);
}

.pay-footer a:hover {
  color: var(--cyan-bright);
}

.pay-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.pay-secure svg {
  width: 12px;
  height: 12px;
}

/* ── Loading Overlay ───────────────────────────────────────────────── */
.pay-loading {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: var(--radius-lg);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}

.pay-loading.active {
  opacity: 1;
  visibility: visible;
}

.pay-loading .pay-spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.pay-loading-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pay-card {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  .pay-main {
    padding: 24px 16px;
    align-items: flex-start;
  }

  .pay-amount {
    font-size: 1.6rem;
  }

  .pay-title {
    font-size: 1.25rem;
  }
}
