/**
 * NLOSMM Payments - Styles
 * Matching the main nlosmm.com design
 */

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #17D588;
  --primary-hover: #1FE094;
  --primary-dark: #10B070;
  --primary-glow: rgba(23, 213, 136, 0.25);
  
  --secondary: #9333EA;
  --secondary-glow: rgba(147, 51, 234, 0.2);
  
  --bg-dark: #0d1321;
  --bg-card: rgba(15, 23, 40, 0.8);
  --bg-card-hover: rgba(25, 35, 57, 0.9);
  --bg-input: rgba(13, 19, 33, 0.9);
  
  --border: rgba(36, 53, 88, 0.5);
  --border-focus: rgba(23, 213, 136, 0.6);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  --success: #17D588;
  --error: #EF4444;
  --warning: #F59E0B;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--primary-glow);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, rgba(36, 53, 88, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 53, 88, 0.08) 1px, transparent 1px);
  background-size: 70px 70px;
  pointer-events: none;
  z-index: 0;
}

/* ===== BACKGROUND GLOWS ===== */
.bg-glow {
  position: fixed;
  pointer-events: none;
  filter: blur(80px);
  animation: glow-pulse 8s ease-in-out infinite;
}

.bg-glow-primary {
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.6;
  z-index: 0;
}

.bg-glow-secondary {
  bottom: -150px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
  opacity: 0.5;
  z-index: 0;
}

.bg-glow-tertiary {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(23, 213, 136, 0.06) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.5;
  z-index: 0;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.bg-glow-tertiary {
  animation: glow-pulse 8s ease-in-out infinite;
  animation-delay: 2s;
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 40px;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 40px;
  width: auto;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.back-link:hover {
  color: var(--primary);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ===== PAYMENT CARD ===== */
.payment-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ===== FORM ===== */
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label svg {
  color: var(--primary);
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(23, 213, 136, 0.1);
}

.input-wrapper input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input-status {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.input-status.show {
  display: flex;
  align-items: center;
}

.input-status.valid::after {
  content: '✓';
  color: var(--success);
  font-weight: bold;
}

.input-status.invalid::after {
  content: '✗';
  color: var(--error);
  font-weight: bold;
}

.input-status.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Currency Input */
.currency-input {
  position: relative;
}

.currency-symbol {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.currency-input input {
  padding-left: 36px;
}

/* ===== AMOUNT GRID ===== */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.amount-btn {
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
}

.amount-btn:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.amount-btn.active {
  background: linear-gradient(135deg, rgba(23, 213, 136, 0.15) 0%, rgba(23, 213, 136, 0.05) 100%);
  border-color: var(--primary);
  color: var(--primary);
}

.amount-btn.custom-btn {
  font-size: 14px;
}

/* Custom Amount */
.custom-amount-wrapper {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  animation: slideDown 0.3s ease;
}

.custom-amount-wrapper.show {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ORDER SUMMARY ===== */
.order-summary {
  background: rgba(23, 213, 136, 0.05);
  border: 1px solid rgba(23, 213, 136, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
}

.summary-row:first-child {
  padding-top: 0;
}

.fee-free {
  color: var(--primary);
  font-weight: 600;
}

#summaryFee {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-divider {
  height: 1px;
  background: rgba(23, 213, 136, 0.2);
  margin: 8px 0;
}

.summary-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-total span:last-child {
  color: var(--primary);
}

/* ===== SUBMIT BUTTON ===== */
.submit-btn {
  width: 100%;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.submit-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-text, .btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-loader {
  display: none;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .btn-loader {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

.spinner circle {
  stroke-dasharray: 80;
  stroke-dashoffset: 60;
  stroke-linecap: round;
}

/* ===== FEE NOTICE ===== */
.fee-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.fee-notice svg {
  color: #F59E0B;
  flex-shrink: 0;
}

/* ===== SECURITY BADGE ===== */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.security-badge svg {
  color: var(--primary);
}

.security-badge strong {
  color: var(--text-secondary);
}

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 800px;
}

.feature {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.feature:hover {
  border-color: var(--border-focus);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(23, 213, 136, 0.15) 0%, rgba(23, 213, 136, 0.05) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.feature h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .payment-card {
    padding: 24px;
  }
  
  .card-title {
    font-size: 24px;
  }
  
  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .amount-btn {
    padding: 14px 12px;
    font-size: 15px;
  }
}

/* ===== SUCCESS PAGE ===== */
.success-card,
.cancel-card {
  text-align: center;
  padding: 48px 40px;
}

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

.status-icon.success {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 0 40px var(--primary-glow);
}

.status-icon.cancel {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
}

.status-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.success-card h1,
.cancel-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.success-card p,
.cancel-card p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.action-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

/* Payment Details */
.payment-details {
  background: rgba(23, 213, 136, 0.05);
  border: 1px solid rgba(23, 213, 136, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.detail-row span:first-child {
  color: var(--text-secondary);
}

.detail-row span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

.detail-row.highlight span:last-child {
  color: var(--primary);
  font-weight: 700;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary) 100%);
}
