/* ============================================
   OpenClaw Cloud SaaS — Design System
   Premium Dark Theme + Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111127;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);

  --text-primary: #f0f0ff;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8e;

  --accent-primary: #7c5cfc;
  --accent-secondary: #5ce1e6;
  --accent-pink: #ff6bcb;
  --accent-green: #00d68f;
  --accent-red: #ff4d6a;
  --accent-orange: #ffaa40;

  --gradient-primary: linear-gradient(135deg, #7c5cfc 0%, #5ce1e6 100%);
  --gradient-hero: linear-gradient(135deg, #7c5cfc 0%, #ff6bcb 50%, #5ce1e6 100%);
  --gradient-card: linear-gradient(135deg, rgba(124, 92, 252, 0.15) 0%, rgba(92, 225, 230, 0.05) 100%);

  --shadow-glow: 0 0 40px rgba(124, 92, 252, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-th: 'Prompt', sans-serif;
  --font-en: 'Inter', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-th);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.3s;
}
a:hover {
  color: var(--accent-primary);
}

/* --- Animated Background --- */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}
.bg-animation .orb:nth-child(1) {
  width: 600px; height: 600px;
  background: var(--accent-primary);
  top: -10%; left: -10%;
  animation-delay: 0s;
}
.bg-animation .orb:nth-child(2) {
  width: 500px; height: 500px;
  background: var(--accent-pink);
  top: 50%; right: -15%;
  animation-delay: -7s;
}
.bg-animation .orb:nth-child(3) {
  width: 400px; height: 400px;
  background: var(--accent-secondary);
  bottom: -5%; left: 30%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 26, 0.8);
  border-bottom: 1px solid var(--border-glass);
}

.logo {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-en);
  color: var(--text-primary);
}
.logo span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo .by {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s;
}
.nav-links a:hover {
  color: var(--text-primary);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--gradient-primary);
  color: white !important;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  -webkit-text-fill-color: white;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 92, 252, 0.4);
}

.btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  background: var(--gradient-primary);
  color: white !important;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-th);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  -webkit-text-fill-color: white;
}
.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-hero);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  filter: blur(20px);
}
.btn-glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(124, 92, 252, 0.5);
}
.btn-glow:hover::before {
  opacity: 1;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-outline:hover {
  background: var(--accent-primary);
  color: white;
}

.btn-success {
  padding: 8px 20px;
  background: var(--accent-green);
  color: #0a0a1a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-success:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-danger {
  padding: 8px 20px;
  background: var(--accent-red);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-danger:hover { opacity: 0.85; transform: translateY(-1px); }

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 80px;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 700px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
}
.hero h1 span {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
}

/* --- Glass Card (Hero) --- */
.hero-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 60px;
  flex-wrap: wrap;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.8s ease-out;
}
.status-card:nth-child(2) { animation-delay: 0.15s; }
.status-card:nth-child(3) { animation-delay: 0.3s; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.green { background: var(--accent-green); }
.status-dot.blue { background: var(--accent-secondary); }
.status-dot.purple { background: var(--accent-primary); }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
}

/* --- Features Section --- */
.features-section {
  padding: 100px 40px;
  position: relative;
  z-index: 1;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}
.section-title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 60px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 92, 252, 0.3);
  box-shadow: var(--shadow-glow);
}
.feature-card:hover::before { opacity: 1; }

.feature-card .icon {
  font-size: 40px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 15px;
  position: relative;
  z-index: 1;
}

/* --- Pricing Section --- */
.pricing-section {
  padding: 100px 40px;
  position: relative;
  z-index: 1;
}

.pricing-cards {
  display: flex;
  gap: 32px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.pricing-card {
  flex: 1;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 40px;
  position: relative;
  transition: all 0.4s ease;
}
.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
}

.pricing-card.popular {
  border-color: var(--accent-primary);
  background: var(--gradient-card);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  background: var(--gradient-primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
}

.pricing-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.price {
  margin-bottom: 32px;
}
.price .currency {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
  vertical-align: top;
}
.price .amount {
  font-size: 56px;
  font-weight: 800;
  font-family: var(--font-en);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.price .period {
  font-size: 16px;
  color: var(--text-muted);
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 32px;
}
.pricing-card ul li {
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pricing-card ul li:last-child { border-bottom: none; }

.btn-buy {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  background: var(--bg-glass);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: all 0.3s;
  -webkit-text-fill-color: var(--text-primary);
}
.btn-buy:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.pricing-card.popular .btn-buy {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white !important;
  -webkit-text-fill-color: white;
}
.pricing-card.popular .btn-buy:hover {
  box-shadow: 0 8px 30px rgba(124, 92, 252, 0.4);
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border-glass);
  position: relative;
  z-index: 1;
}

/* --- Page Container (for checkout, order-status, admin) --- */
.page-container {
  max-width: 650px;
  margin: 100px auto 60px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.page-container.wide {
  max-width: 1100px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* --- Glass Panel --- */
.glass-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(20px);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 24px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-th);
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}
.form-group input::placeholder {
  color: var(--text-muted);
}
.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* --- Plan Cards (Checkout) --- */
.plan-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.plan-option {
  flex: 1;
  padding: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}
.plan-option:hover {
  border-color: rgba(124, 92, 252, 0.4);
}
.plan-option.selected {
  border-color: var(--accent-primary);
  background: var(--gradient-card);
}
.plan-option .plan-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.plan-option .plan-price {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-en);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-option .plan-spec {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- QR Section --- */
.qr-section {
  text-align: center;
  padding: 40px;
}
.qr-section img {
  max-width: 300px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  background: white;
  padding: 12px;
}
.order-ref {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-secondary);
  letter-spacing: 1px;
}

/* --- Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.status-badge.pending {
  background: rgba(255, 170, 64, 0.15);
  color: var(--accent-orange);
}
.status-badge.paid, .status-badge.provisioning {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-primary);
}
.status-badge.active {
  background: rgba(0, 214, 143, 0.15);
  color: var(--accent-green);
}
.status-badge.rejected {
  background: rgba(255, 77, 106, 0.15);
  color: var(--accent-red);
}

/* --- Order Status Result --- */
.status-result {
  margin-top: 32px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.info-row .label {
  color: var(--text-muted);
}
.info-row .value {
  font-weight: 600;
  font-family: var(--font-en);
}

.access-box {
  margin-top: 24px;
  padding: 24px;
  background: rgba(0, 214, 143, 0.08);
  border: 1px solid rgba(0, 214, 143, 0.2);
  border-radius: var(--radius-md);
}
.access-box h3 {
  color: var(--accent-green);
  margin-bottom: 16px;
}

/* --- Admin Dashboard Tables --- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-th);
  cursor: pointer;
  transition: all 0.3s;
}
.tab-btn.active {
  background: var(--accent-primary);
  color: white;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: var(--bg-card-hover);
}
.data-table .actions {
  display: flex;
  gap: 8px;
}

/* --- Stats Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-en);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Login Form --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
}
.login-card .logo-section {
  text-align: center;
  margin-bottom: 32px;
}
.login-card .logo-section h1 {
  font-size: 28px;
  font-weight: 700;
}
.login-card .logo-section p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

/* --- Alert Messages --- */
.alert {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  display: none;
  animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideDown {
  from { top: -20px; opacity: 0; transform: translate(-50%, -20px); }
  to { top: 100px; opacity: 1; transform: translate(-50%, 0); }
}
.alert.show { display: block; }
.alert.error {
  background: rgba(255, 77, 106, 0.95);
  border: 1px solid var(--accent-red);
  color: white;
  backdrop-filter: blur(10px);
}
.alert.success {
  background: rgba(0, 214, 143, 0.95);
  border: 1px solid var(--accent-green);
  color: #0a0a1a;
  backdrop-filter: blur(10px);
}

/* --- Modals --- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-content {
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- Loading spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Hide/Show --- */
.hidden { display: none !important; }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .navbar { padding: 12px 20px; }
  .nav-links { gap: 16px; }
  .hero { padding: 100px 20px 60px; }
  .hero h1 { font-size: 28px; }
  .features-section, .pricing-section { padding: 60px 20px; }
  .pricing-cards { flex-direction: column; align-items: center; }
  .pricing-card { min-width: 100%; }
  .plan-selector { flex-direction: column; }
  .page-container { margin-top: 80px; padding: 0 16px; }
  .glass-panel { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 8px; }
}
