/* ============================================
   JP Management — Checkout
   Light Mode Default
   ============================================ */

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

:root {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --primary: #2196F3;
  --primary-hover: #1976D2;
  --crypto: #10b981;
  --crypto-hover: #059669;
  --error: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-sm: 6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.header .container {
  display: flex;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}

.header-brand .logo {
  height: 32px;
  width: auto;
}

.header-brand span {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* --- Checkout --- */
.checkout-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.checkout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
}

.checkout-card.expanded {
  max-width: 540px;
}

.product-info {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.product-info h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-info .description {
  color: var(--text-muted);
  font-size: 0.825rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.product-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

.product-price .currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* --- Form --- */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 20px;
}

.form-checkbox input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.form-checkbox label {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.form-error {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* --- Buttons --- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-crypto {
  background: var(--crypto);
  color: #fff;
}

.btn-crypto:hover {
  background: var(--crypto-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.payment-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* --- Contact CTA --- */
.contact-cta {
  text-align: center;
}

.contact-cta p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.contact-cta .btn {
  margin-bottom: 8px;
}

/* --- Error State --- */
.error-state {
  text-align: center;
}

.error-state h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.error-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* --- Spinner --- */
.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: spin 0.6s linear infinite;
}

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

/* --- Status Pages --- */
.status-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.status-content { max-width: 400px; }

.status-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.status-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.status-content .btn {
  margin-top: 20px;
  width: auto;
  display: inline-flex;
}

/* --- Legal --- */
.legal-page {
  flex: 1;
  padding: 40px 0;
}

.legal-page .container { max-width: 680px; }

.legal-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.legal-page h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.legal-page p, .legal-page li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-page ul {
  padding-left: 18px;
  margin-bottom: 10px;
}

/* --- Footer --- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* --- Crypto Checkout Form --- */
.crypto-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.crypto-form-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

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

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

#crypto-form .form-group {
  margin-bottom: 10px;
}

#crypto-form .form-group label {
  font-size: 0.72rem;
  margin-bottom: 3px;
}

#crypto-form .form-group input,
#crypto-form .form-group select {
  padding: 8px 10px;
  font-size: 0.82rem;
}

#crypto-form .form-checkbox {
  margin: 10px 0 12px;
}

.form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.price-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

.price-row.price-total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--crypto);
}

.btn-confirm {
  margin-top: 2px;
  padding: 12px;
  font-size: 0.9rem;
}

#crypto-error {
  text-align: center;
  margin-bottom: 8px;
}

/* --- Divus Theme (dark + gold) --- */
body.theme-divus {
  --bg: #000000;
  --bg-card: #111111;
  --text: #ffffff;
  --text-secondary: #e8d89a;
  --text-muted: #9a8a5c;
  --border: #3a2f14;
  --primary: #d4af37;
  --primary-hover: #f0c94a;
  --crypto: #d4af37;
  --crypto-hover: #f0c94a;
  --shadow: 0 1px 3px rgba(0,0,0,0.8), 0 12px 32px rgba(0,0,0,0.6);
  background: #000000 !important;
  color: #ffffff;
}

body.theme-divus .header,
body.theme-divus .footer {
  background: #000000;
  border-color: #2a2416;
}

body.theme-divus .checkout-card {
  background: #111111 !important;
  border: 1px solid #3a2f14 !important;
  color: #ffffff;
}

body.theme-divus .product-info {
  border-bottom-color: #3a2f14;
}

body.theme-divus .product-info h1,
body.theme-divus .product-price {
  color: #d4af37;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

body.theme-divus .product-price .currency {
  color: #b8941f;
}

body.theme-divus .product-info .description {
  color: #d4c99a;
}

body.theme-divus .form-group label,
body.theme-divus .form-checkbox label {
  color: #e8d89a;
}

body.theme-divus .form-group input[type="text"],
body.theme-divus .form-group input[type="email"],
body.theme-divus .form-group select {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #3a2f14;
}

body.theme-divus .form-group input::placeholder {
  color: #6a5f3c;
}

body.theme-divus .form-group input:focus,
body.theme-divus .form-group select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

body.theme-divus .form-checkbox input[type="checkbox"] {
  accent-color: #d4af37;
}

body.theme-divus .btn-primary,
body.theme-divus .btn-crypto {
  background: linear-gradient(180deg, #e8c252 0%, #d4af37 50%, #b8941f 100%);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

body.theme-divus .btn-primary:hover,
body.theme-divus .btn-crypto:hover {
  background: linear-gradient(180deg, #f0c94a 0%, #e8c252 50%, #d4af37 100%);
  color: #000000;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

body.theme-divus .price-row {
  color: #e8d89a;
}

body.theme-divus .price-row.price-total {
  color: #d4af37;
  border-top-color: #3a2f14;
}

body.theme-divus .price-summary {
  background: #1a1a1a;
  border-color: #3a2f14;
}

body.theme-divus .secure-badge,
body.theme-divus .footer-copy,
body.theme-divus .footer-links a {
  color: #8a7d5c;
}

body.theme-divus .footer-links a:hover {
  color: #d4af37;
}

body.theme-divus .header-brand span {
  color: #d4af37;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

body.theme-divus a {
  color: #d4af37;
}

body.theme-divus a:hover {
  color: #f0c94a;
}

body.theme-divus .back-btn {
  background: #1a1a1a;
  border-color: #3a2f14;
  color: #e8d89a;
}

body.theme-divus .back-btn:hover {
  background: #2a2416;
  color: #d4af37;
}

body.theme-divus .crypto-form-header {
  border-bottom-color: #3a2f14;
}

body.theme-divus .crypto-form-header h3 {
  color: #d4af37;
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .payment-buttons {
    flex-direction: row;
  }

  .checkout-card {
    max-width: 480px;
  }
}
