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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --bg-input: #0e0e16;
  --cyan: #00f0ff;
  --purple: #7b2fff;
  --gradient: linear-gradient(135deg, var(--cyan), var(--purple));
  --text: #e0e0e0;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --border: #1e1e30;
  --border-glow: rgba(0, 240, 255, 0.15);
  --success: #00e676;
  --warning: #ffab00;
  --danger: #ff3d71;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.1), 0 0 40px rgba(123, 47, 255, 0.05);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* ===== UTILITIES ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35), 0 0 48px rgba(123, 47, 255, 0.15);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-md {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, rgba(123, 47, 255, 0.04) 40%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Pulse glow animation */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 32px rgba(0, 240, 255, 0.4), 0 0 64px rgba(123, 47, 255, 0.2);
  }
}

/* ===== FEATURES ===== */
.features {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

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

.feature-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== PLANS ===== */
.plans-section {
  padding: 80px 0;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.plan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.plan-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.plan-card:hover::before {
  opacity: 1;
}

.plan-card.popular {
  border-color: rgba(0, 240, 255, 0.3);
}

.plan-card.popular::before {
  opacity: 1;
}

.plan-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan-price .currency {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.plan-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.plan-features {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}

.plan-features li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: '\2713';
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.8rem;
}

.plan-card .btn {
  width: 100%;
}

/* ===== DASHBOARD ===== */
.dashboard {
  padding: 32px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.dash-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.dash-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dash-card-header h2 {
  margin-bottom: 0;
}

/* Status badge */
.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.status-trial {
  background: rgba(0, 240, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.status-expired {
  background: rgba(255, 61, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 61, 113, 0.25);
}

/* Subscription details */
.sub-no-active {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.sub-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sub-value {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--cyan);
}

/* VPN Connection card */
.vpn-card h2 {
  margin-bottom: 20px;
}

.sub-link-block {
  margin-bottom: 24px;
}

.sub-link-block label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.input-dark {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
  transition: border-color 0.2s;
}

.input-dark:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

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

.qr-container {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.connect-instructions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.connect-instructions h3 {
  color: var(--text);
  margin-bottom: 12px;
}

.connect-instructions ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connect-instructions li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Profile sections */
.profile-section {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.profile-section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.input-row {
  display: flex;
  gap: 8px;
}

.email-status {
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.email-status .verified {
  color: var(--success);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Coupon result */
.coupon-result {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.coupon-result.success {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.coupon-result.error {
  background: rgba(255, 61, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 61, 113, 0.2);
}

/* Balance */
.balance-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance-amount {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== MODALS ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-btn {
  min-width: 160px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-glow);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
  border-color: rgba(255, 61, 113, 0.4);
  color: var(--danger);
}

.toast.toast-success {
  border-color: rgba(0, 230, 118, 0.4);
  color: var(--success);
}

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 10, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== FOOTER ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text-sm {
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0 50px;
  }

  .hero-stats {
    gap: 24px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .features {
    padding: 50px 0;
  }

  .plans-section {
    padding: 50px 0;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .dash-card {
    padding: 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .copy-row {
    flex-direction: column;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    flex-wrap: wrap;
  }

  .header-inner {
    height: 56px;
  }

  .balance-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
  }
}
