/* ============================================
   Arctickale Web Panel - Main Styles
   ============================================ */

/* === CSS Variables === */
:root {
  /* Colors */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #252b3b;
  --bg-hover: #2d3548;

  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --accent-primary: #0ea5e9;
  --accent-secondary: #0284c7;

  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --border-color: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Primary color — тёмная тема: более тёмный голубой */
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
}

/* === Light Theme === */
[data-theme="light"] {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-hover: #dee2e6;

  --text-primary: #1a1a1a;
  --text-secondary: #495057;
  --text-muted: #6c757d;

  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  --accent-primary: #38bdf8;
  --accent-secondary: #0ea5e9;

  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --border-color: #dee2e6;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  opacity: 1;
  padding-top: 70px;
}

/* Page fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body.page-loaded {
  animation: fadeIn 0.15s ease-out;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

/* === Layout === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* === Page and Section Titles === */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xl);
  line-height: 1.3;
}

.section {
  margin-bottom: var(--spacing-2xl);
}

.section-header {
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }

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

/* === Stats Grid & Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-2xl);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.stat-card-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon .material-icons {
  font-size: 1.5rem;
}

.stat-card-icon-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.stat-card-icon-primary {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary);
}

.stat-card-icon-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card-icon-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card-icon-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Server Stats Container */
.server-stats-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.server-stat-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.server-stat-bar:first-child {
  margin-top: 0;
}

.server-stat-bar:last-child {
  margin-bottom: 0;
}

.server-stat-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
}

.server-stat-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-md);
}

.server-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.server-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .server-stat-items {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .server-stat-item {
    gap: 0.25rem;
  }

  .server-stat-label {
    font-size: 0.75rem;
  }

  .server-stat-value {
    font-size: 1rem;
  }
}

/* Empty State */
.empty-state {
  padding: var(--spacing-2xl);
  text-align: center;
  color: var(--text-muted);
}

.empty-state .material-icons {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.7;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.empty-state-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.action-bar-left {
  flex: 1;
  min-width: 200px;
}

.action-bar-right {
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* === Card Component === */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 0;
}

/* === Button Component === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  gap: var(--spacing-sm);
  height: 44px;
  padding: 0 1.5rem;
  box-sizing: border-box;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus,
.btn:active,
.btn:focus-visible {
  outline: none !important;
  border: none !important;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.625rem;
  width: 2.5rem;
  height: 2.5rem;
}

/* === Form Elements === */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--error);
  font-size: 0.8125rem;
  margin-top: var(--spacing-xs);
  display: block;
}

/* === Table Component === */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table[style*="border-radius"] {
  overflow: hidden;
}

.table thead {
  background: var(--bg-tertiary);
}

.table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* === Badge Component === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* === Loading Spinner === */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
}

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

/* === Connections Grid & Cards === */
.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* #subscription-block fills flex container via inline CSS in sub-and-tariff-row */

.connection-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* QR in non-promo cards: keep inside card, no stretch (align-self keeps block from stretching) */
.connection-header-compact .connection-qr-preview {
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(120px, 100%);
  min-width: 0;
}

.connection-qr-preview .qr-preview-container {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  flex-shrink: 0;
  aspect-ratio: 1;
  overflow: hidden;
}

.connection-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.connection-card-compact {
  padding: var(--spacing-xl);
}


.connection-header-compact {
  display: flex;
  gap: var(--spacing-xl);
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.connection-main-info {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  box-sizing: border-box;
}

.connection-title-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.connection-email,
.subscription-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.connection-status-badge,
.subscription-status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.subscription-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
  min-width: 0;
  width: 100%;
}

.subscription-feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  min-width: 0;
}

.subscription-feature-item span:last-child {
  flex: 1;
  min-width: 0;
}

.subscription-feature-item .material-icons {
  font-size: 1.125rem;
  color: var(--primary);
}

.connection-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.connection-meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.connection-meta-item .material-icons {
  font-size: 1.125rem;
}

.subscription-footer {
  margin-top: var(--spacing-md);
}

.subscription-countdown-block {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

.subscription-countdown-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.subscription-countdown-timer {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.subscription-qr-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.subscription-qr-section .qr-preview-container {
  width: 200px;
  height: 200px;
  min-width: 200px;
  min-height: 200px;
  max-width: 200px;
  max-height: 200px;
  aspect-ratio: 1;
  overflow: hidden;
  flex-shrink: 0;
}

.subscription-qr-section .qr-preview-container canvas,
.subscription-qr-section .qr-preview-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.qr-preview-container {
  background: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  aspect-ratio: 1;
  overflow: hidden;
  box-sizing: border-box;
}

.qr-preview-container:hover {
  box-shadow: var(--shadow-md);
}

.qr-preview-container canvas,
.qr-preview-container img,
.qr-preview-container table {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  border-radius: var(--radius-sm);
}

.qr-preview-container img,
.qr-preview-container canvas {
  object-fit: contain;
}

/* qrcode.js renders a table; keep it square and contained */
.qr-preview-container table {
  margin: 0 auto;
}

.subscription-connect-btn-desktop,
.subscription-connect-btn-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
}

.subscription-connect-btn-mobile {
  display: none;
}

.connection-connect-btn {
  margin-top: auto;
}

/* === Mobile === */
@media (max-width: 768px) {
  .connections-grid {
    grid-template-columns: 1fr;
  }

  /* All cards: keep ROW layout on mobile — QR stays top-right */
  .connection-card .connection-header-compact {
    flex-direction: row !important;
    align-items: flex-start !important;
  }

  .connection-card .connection-main-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .connection-card .connection-qr-preview {
    flex-shrink: 0;
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
}

@media (min-width: 769px) {
  .subscription-timer-qr-row .subscription-footer-in-row {
    flex: 1;
  }
}

/* === Pricing Section === */
.pricing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.pricing-cards-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-xl);
  margin-top: var(--spacing-2xl);
}

.pricing-col {
  display: flex;
  flex-direction: column;
}

.pricing-trial-card-wrapper,
.pricing-card-wrapper {
  position: relative;
  height: 100%;
}

.pricing-trial-card,
.pricing-card-main {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  height: 100%;
  overflow: hidden;
  transition: all var(--transition-base);
}

.pricing-trial-card:hover,
.pricing-card-main:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.pricing-trial-card-bg-blur,
.pricing-card-bg-blur {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.pricing-trial-card-content,
.pricing-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
  height: 100%;
}

.pricing-trial-card-left,
.pricing-card-left {
  flex: 1;
}

.pricing-trial-card-right,
.pricing-card-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.pricing-trial-badge,
.pricing-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--spacing-sm);
}

.pricing-trial-plan-name,
.pricing-plan-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.pricing-trial-features-list,
.pricing-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.pricing-trial-features-list li,
.pricing-features-list li {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.pricing-trial-features-list .material-icons-outlined,
.pricing-features-list .material-icons-outlined {
  color: var(--success);
  font-size: 1.25rem;
}

.pricing-trial-amount,
.pricing-amount {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.pricing-trial-amount-value,
.pricing-amount-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.pricing-trial-amount-period,
.pricing-amount-period {
  display: block;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
}

.btn-pricing-trial,
.btn-pricing-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  min-width: 160px;
}

.btn-pricing-trial:hover,
.btn-pricing-primary:hover {
  background: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pricing-trial-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--spacing-sm);
  line-height: 1.4;
}

@media (max-width: 1024px) {
  .pricing-cards-row {
    grid-template-columns: 1fr;
  }

  .pricing-trial-card-content,
  .pricing-card-content {
    flex-direction: column;
    text-align: center;
  }

  .pricing-trial-card-left,
  .pricing-card-left {
    width: 100%;
  }

  .pricing-trial-card-right,
  .pricing-card-right {
    width: 100%;
  }
}

/* === Join Section === */
.join-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--spacing-2xl);
}

.join-animated-shape {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

.join-shape-2 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.join-shape-3 {
  width: 200px;
  height: 200px;
  top: 60%;
  right: 15%;
  animation-delay: 5s;
}

.join-shape-4 {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 20%;
  animation-delay: 10s;
}

.join-shape-5 {
  width: 250px;
  height: 250px;
  top: 30%;
  right: 25%;
  animation-delay: 15s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translate(30px, -30px) scale(1.1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-20px, 20px) scale(0.9);
    opacity: 0.3;
  }
  75% {
    transform: translate(20px, 30px) scale(1.05);
    opacity: 0.4;
  }
}

.join-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.join-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;
}

.join-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-2xl);
  line-height: 1.6;
}

.btn-join-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 1rem 2.5rem;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.btn-join-primary:hover {
  background: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-join-primary .material-icons-outlined {
  transition: transform var(--transition-base);
}

.btn-join-primary:hover .material-icons-outlined {
  transform: translateX(4px);
}

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

  .join-description {
    font-size: 1rem;
  }

  .btn-join-primary {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

  .join-animated-shape {
    display: none;
  }
}

/* === Scroll Reveal Animations === */
.block-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.block-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-with-reveal {
  position: relative;
}

/* Reveal on scroll initialization */
@media (prefers-reduced-motion: reduce) {
  .block-reveal {
    opacity: 1;
    transform: none;
  }
}

/* === Pricing Comparison Table === */
.pricing-comparison-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  overflow: hidden;
}

.pricing-comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
}

.pricing-comp-banner-row {
  height: 2.5rem;
}

.pricing-comp-banner-inline {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-comparison-table th,
.pricing-comparison-table td {
  padding: var(--spacing-md);
  text-align: center;
  border: 1px solid var(--border-color);
}

.pricing-comp-param {
  text-align: left !important;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  min-width: 160px;
}

.pricing-comp-col {
  min-width: 140px;
}

.pricing-comp-pro-col {
  background: rgba(102, 126, 234, 0.05);
  border-left: 2px solid var(--primary) !important;
  border-right: 2px solid var(--primary) !important;
}

.pricing-comp-banner-row .pricing-comp-pro-col {
  border-top: 2px solid var(--primary) !important;
}

.pricing-comp-cell-empty {
  border: none !important;
  background: transparent !important;
}

.pricing-comp-round-tl {
  border-top-left-radius: var(--radius-lg);
}

.pricing-comp-round-tr {
  border-top-right-radius: var(--radius-lg);
}

.pricing-year-accent {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pricing-old {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.pricing-discount-small {
  display: inline-block;
  background: var(--error);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

@media (max-width: 768px) {
  .pricing-comparison-table {
    font-size: 0.875rem;
  }

  .pricing-comparison-table th,
  .pricing-comparison-table td {
    padding: var(--spacing-sm);
  }

  .pricing-comp-param {
    min-width: 120px;
  }

  .pricing-comp-col {
    min-width: 100px;
  }
}

/* === Benefits Grid === */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.benefit-item:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.benefit-item .material-icons {
  color: var(--primary);
  font-size: 2rem;
  flex-shrink: 0;
}

.benefit-item span:last-child {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

/* === Settings Page === */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3xl);
}

.settings-section {
  position: relative;
  padding: 0;
}

.settings-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-lg);
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--primary);
}

.settings-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--spacing-lg);
  align-items: start;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  transition: background var(--transition-base);
}

.settings-row:hover {
  background: var(--bg-tertiary);
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-row label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding-top: 0.75rem;
  line-height: 1.5;
}

.settings-row .hint {
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  line-height: 1.5;
}

.settings-row > input,
.settings-row > select,
.settings-row > button {
  grid-column: 2;
}

.settings-row > .form-input,
.settings-row > .form-select {
  max-width: 400px;
}

/* Dropdown wrapper in settings */
.settings-row .trial-servers-dropdown-wrapper {
  grid-column: 2;
  max-width: 400px;
}

@media (max-width: 1024px) {
  .settings-row {
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
  }

  .settings-row label {
    padding-top: 0;
  }

  .settings-row .hint {
    grid-column: 1;
  }

  .settings-row > input,
  .settings-row > select,
  .settings-row > button {
    grid-column: 1;
  }

  .settings-row > .form-input,
  .settings-row > .form-select,
  .settings-row .trial-servers-dropdown-wrapper {
    max-width: none;
  }

  .settings-row .trial-servers-dropdown-wrapper {
    grid-column: 1;
  }
}

/* === Toast Notifications === */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInUp 0.3s ease-out;
  transition: all 0.3s ease;
  cursor: pointer;
}

.toast:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.removing {
  animation: slideOutDown 0.3s ease-out forwards;
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .toast-container {
    top: auto;
    bottom: 5rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
  
  .toast {
    width: 100%;
  }
}

/* === Modal Windows === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-small {
  width: 100%;
  max-width: 400px;
}

.modal-medium {
  width: 100%;
  max-width: 560px;
}

.modal-large {
  width: 100%;
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem 0 0 0;
  border-radius: var(--radius-md);
  transition: color var(--transition-base), background var(--transition-base);
}

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

.modal-close:focus {
  outline: none;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  color: var(--text-primary);
  flex: 1;
  min-height: 0;
}

.modal-body .form-group,
.modal-body .form-label,
.modal-body .form-input {
  margin-bottom: 0.75rem;
}

/* QR Code in Modal */
.modal-body #qr-container {
  display: inline-block;
  padding: 1rem;
  background: white !important;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.modal-body #qr-container:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.modal-body #qr-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.modal-body #qr-link-input {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
}

.modal-body .flex.gap-sm {
  display: flex;
  gap: var(--spacing-sm);
  align-items: stretch;
}

.modal-body .flex.gap-sm .form-input {
  flex: 1;
  margin-bottom: 0;
}

/* QR Modal Specific Styles (from qrGenerator.js) */
.qr-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.qr-modal-qr {
  display: inline-block;
  padding: var(--spacing-md);
  background: white !important;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.qr-modal-qr:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.qr-modal-qr canvas,
.qr-modal-qr img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-modal-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.qr-modal-link-section {
  width: 100%;
}

.qr-modal-link-input-wrapper {
  display: flex;
  gap: var(--spacing-sm);
  align-items: stretch;
}

.qr-modal-link-input-wrapper .form-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  margin-bottom: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

.modal-footer .btn {
  margin: 0;
}

/* === Utility Classes === */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

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

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.text-warning {
  color: var(--warning);
}

.text-info {
  color: var(--info);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mt-xl {
  margin-top: var(--spacing-xl);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mb-xl {
  margin-bottom: var(--spacing-xl);
}

.hidden {
  display: none !important;
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

/* === Responsive Base === */
/* Mobile-first approach - base styles are mobile, then scale up */

/* Ensure all sizes are relative */
html {
  font-size: 16px;
  /* Base for rem calculations */
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  html {
    font-size: 15px;
  }

  .container {
    max-width: 960px;
    padding: 0 var(--spacing-lg);
  }
}

/* Desktop */
@media (min-width: 1025px) {
  html {
    font-size: 16px;
  }

  .container {
    max-width: 1400px;
  }
}

/* Mobile specific (kept for backwards compatibility) */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .card {
    padding: var(--spacing-md);
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .table-wrapper {
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
    /* Force horizontal scroll on small screens */
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }
}

/* === Sortable Table Headers === */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 2rem;
}

.table th.sortable:hover {
  background: var(--bg-hover);
}

.table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 0.75rem;
  opacity: 0.3;
  font-size: 0.875rem;
}

.table th.sortable.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--primary);
}

.table th.sortable.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--primary);
}

/* === Auto Refresh Container === */
.auto-refresh-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.auto-refresh-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  border-radius: 12px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: all var(--transition-base);
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--success);
  border-color: var(--success);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(20px);
  background-color: white;
}

.toggle-switch input:disabled+.toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Theme Toggle Button === */
.theme-toggle {
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-primary);
}

.theme-toggle .material-icons,
.theme-toggle .theme-icon {
  font-size: 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.theme-toggle:focus,
.theme-toggle:active,
.theme-toggle:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.theme-toggle:hover {
  background: var(--bg-hover);
}

.theme-toggle:hover .material-icons,
.theme-toggle:hover .theme-icon {
  color: var(--primary);
}

/* === CSS Updates for Arctickale === */

/* Fix Dropdown Style */
.auto-refresh-interval {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  color-scheme: dark !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

[data-theme="light"] .auto-refresh-interval {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  color-scheme: light !important;
}

.auto-refresh-interval:focus {
  border-color: var(--primary);
}

.auto-refresh-interval:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Select dropdown options and styling */
.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
  color-scheme: dark !important;
}

.form-select option {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .form-select {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  color-scheme: light !important;
}

.server-select {
  cursor: pointer;
}

/* Align Actions to Right */
.table td:last-child {
  text-align: right;
}

.table td:last-child .flex {
  justify-content: flex-end;
}

/* Remove Hover/Line from Users Card Header */
.card-header {
  border-bottom: none !important;
}

.card-title {
  pointer-events: none;
}

/* Neutral Delete Button - styles applied via .btn-sm and .btn-secondary */


/* === Scrollbar Styles === */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-md);
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-secondary);
}

/* === Admin Sidebar (desktop, вместо хедера) === */
.admin-sidebar {
  display: none;
}

@media (min-width: 769px) {
  .admin-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: 280px;
    height: auto;
    min-height: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    z-index: 1000;
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }
  body.has-admin-sidebar {
    padding-top: 0;
    padding-left: 304px;
  }
  body.has-admin-sidebar .navbar,
  body.has-admin-sidebar .navbar.dynamic-island {
    display: none;
  }
  .admin-sidebar-header {
    padding: var(--spacing-lg);
    flex-shrink: 0;
    text-align: center;
  }
  .admin-sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-md) var(--spacing-md) 0;
    flex-shrink: 0;
  }
  .admin-sidebar-footer .admin-sidebar-divider {
    margin: 0 var(--spacing-md) var(--spacing-md);
  }
  .admin-sidebar-brand {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    text-align: center;
  }
  .admin-sidebar-brand:hover {
    opacity: 0.9;
  }
  .admin-sidebar-menu {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    min-height: 0;
  }
  .admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .admin-sidebar-link .admin-sidebar-link-icon {
    font-size: 20px;
    opacity: 0.9;
  }
  .admin-sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }
  .admin-sidebar-link.active {
    background: var(--primary);
    color: #fff;
  }
  .admin-sidebar-link.active .admin-sidebar-link-icon {
    opacity: 1;
  }
  .admin-sidebar-footer {
    padding: var(--spacing-md);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .admin-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
  }
  .admin-sidebar-btn:hover {
    background: var(--bg-hover);
  }
  .admin-sidebar-btn .material-icons {
    font-size: 20px;
  }
  .admin-sidebar-user-btn {
    cursor: pointer;
  }
  .admin-sidebar-user-btn .admin-sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }
  .admin-sidebar-username {
    flex: 1;
    font-size: 0.875rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }
  .admin-sidebar-user-row .admin-sidebar-btn.admin-sidebar-user-btn {
    flex: 1;
    min-width: 0;
  }
  .admin-sidebar-logout-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
  }
  .admin-sidebar-logout-icon:hover {
    background: var(--bg-hover);
  }
  .admin-sidebar-logout-icon .material-icons {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  body.has-admin-sidebar {
    padding-left: 0;
    padding-top: 70px;
  }
}

/* === Payments filters row (stable layout at any resolution) === */
.payments-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.payments-filters-search {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
}

.payments-filters-search .search-box {
  width: 100%;
}

.payments-filters-search .search-input {
  width: 100%;
  min-width: 0;
}

.payments-filters-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-width: 0;
}

.payments-filters-group .form-label {
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.payments-filters-group .form-input,
.payments-filters-group .form-select {
  width: 100%;
  min-width: 120px;
  max-width: 160px;
  cursor: pointer;
}

.payments-filters-apply {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .payments-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .payments-filters-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .payments-filters-group {
    flex: 1 1 auto;
  }

  .payments-filters-group .form-input,
  .payments-filters-group .form-select {
    max-width: none;
    flex: 1;
  }
}

/* === Navbar Styles === */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

/* Dynamic Island — centered, with top and side margins */
body:not(.has-admin-sidebar) .navbar,
body:not(.has-admin-sidebar) .navbar.dynamic-island {
  background: rgba(26, 31, 46, 0.8) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem !important;
  border-bottom: none !important;
  margin: 0 !important;
  width: min(1200px, calc(100% - 2rem)) !important;
  max-width: calc(100% - 2rem) !important;
  position: fixed !important;
  top: 1rem !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  min-height: 3rem;
  max-height: 4rem;
}

/* No outline/ring on navbar interactive elements only (keep navbar box-shadow) */
body:not(.has-admin-sidebar) .navbar {
  outline: none !important;
}

body:not(.has-admin-sidebar) .navbar *,
body:not(.has-admin-sidebar) .navbar a,
body:not(.has-admin-sidebar) .navbar button {
  outline: none !important;
  box-shadow: none !important;
}

body:not(.has-admin-sidebar) .navbar a:focus,
body:not(.has-admin-sidebar) .navbar button:focus,
body:not(.has-admin-sidebar) .navbar a:focus-visible,
body:not(.has-admin-sidebar) .navbar button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

[data-theme="light"] body:not(.has-admin-sidebar) .navbar,
[data-theme="light"] body:not(.has-admin-sidebar) .navbar.dynamic-island {
  background: rgba(255, 255, 255, 0.8) !important;
}

/* Welcome: hide border/shadow when header hidden */
.welcome-page .navbar.dynamic-island {
  border: none !important;
  box-shadow: none !important;
}

/* Welcome: hide header at start (desktop only), keep centered */
@media (min-width: 769px) {
  .welcome-page #app-navbar .navbar,
  .welcome-page #app-navbar .navbar.dynamic-island {
    transform: translateX(-50%) translateY(calc(-100% - 1rem)) !important;
    transition: transform 0.35s ease !important;
  }
  .welcome-page.header-scrolled #app-navbar .navbar,
  .welcome-page.header-scrolled #app-navbar .navbar.dynamic-island,
  .welcome-page.header-navbar-hover #app-navbar .navbar,
  .welcome-page.header-navbar-hover #app-navbar .navbar.dynamic-island {
    transform: translateX(-50%) translateY(0) !important;
  }
}

/* Restore border only top and sides when visible on welcome (no bottom, like other pages) */
.welcome-page.header-scrolled .navbar.dynamic-island,
.welcome-page.header-navbar-hover .navbar.dynamic-island {
  border: 1px solid var(--border-color) !important;
  border-bottom: none !important;
  box-shadow: var(--shadow-md) !important;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: 0.5rem var(--spacing-lg);
  max-width: 1400px;
  margin: 0 auto;
  min-height: 0;
  flex-shrink: 0;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
}

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

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  position: relative;
}

.navbar-menu.has-active::before {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: var(--indicator-left, 0);
  width: var(--indicator-width, 0);
  height: 2px;
  background: var(--primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px 2px 0 0;
}

.navbar-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.navbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.navbar-link.active {
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
}

.navbar-link-icon {
  font-size: 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  flex-shrink: 0;
}

/* Crisp icons in navbar (PC) */
@media (min-width: 769px) {
  .navbar .material-icons {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
  max-height: 2.5rem;
}

.navbar-user:hover {
  background: transparent;
}

.navbar-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.navbar-user #user-info,
.navbar-user .text-sm {
  font-size: 0.8125rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.navbar-logout-btn {
  padding: 0.25rem !important;
  min-width: auto !important;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-base);
}

.hamburger-btn:hover {
  background: var(--bg-hover);
}

/* === Mobile Menu (bottom sheet, overlay above header) === */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-sidebar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(400px, calc(100% - 2rem));
  max-height: min(70vh, 500px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 1.25rem 1.25rem 0 0;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.mobile-sidebar.active {
  transform: translateX(-50%) translateY(0);
}

.mobile-sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  text-align: center;
}

.mobile-sidebar-brand {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mobile-sidebar-menu {
  flex: 0 1 auto;
  padding: var(--spacing-md);
  overflow-y: auto;
  max-height: 50vh;
}

.mobile-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all var(--transition-base);
}

.mobile-sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mobile-sidebar-link.active {
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
}

.mobile-sidebar-link-icon {
  font-size: 20px;
  opacity: 0.9;
}

.mobile-sidebar-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.mobile-sidebar-user-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.mobile-sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-sidebar-username {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}

.mobile-sidebar-action-btn:hover {
  background: var(--primary-hover);
}

.mobile-sidebar-logout-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.5rem;
  flex: 0 0 auto;
  width: auto;
}

.mobile-sidebar-logout-btn:hover {
  background: var(--bg-hover);
}

.mobile-sidebar-action-label {
  display: none;
}

/* === Footer Styles (match welcome page) === */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-brand-name {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.footer-brand-separator {
  color: var(--text-secondary);
}

.footer-brand-copyright {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

.footer-social {
  display: flex;
  gap: var(--spacing-sm);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-base);
  border: none;
  outline: none;
}

.footer-social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.footer-social-link:focus {
  outline: none;
  box-shadow: none;
}

/* === FAQ Styles === */
.faq-section {
  min-height: calc(100vh - 140px);
  padding: var(--spacing-2xl) 0;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.faq-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.faq-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.faq-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: var(--bg-primary);
  overflow: hidden;
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
  user-select: none;
}

.faq-item summary:hover {
  background: var(--bg-secondary);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "expand_more";
  font-family: "Material Icons Outlined";
  color: var(--text-secondary);
  font-size: 24px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "expand_less";
}

.faq-content {
  padding: 0 1.5rem 1.25rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-content p {
  margin-bottom: var(--spacing-sm);
}

.faq-content p:last-child {
  margin-bottom: 0;
}

.faq-price-year {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* === Welcome Page Styles === */
.welcome-page {
  background: var(--bg-primary);
}

/* Welcome page header behavior - hide initially on desktop */
@media (min-width: 769px) {
  .welcome-page #app-navbar .navbar {
    transform: translateY(-100%);
    transition: transform 0.35s ease;
  }
  
  /* Show header when scrolled or hovered */
  .welcome-page.header-scrolled #app-navbar .navbar,
  .welcome-page.header-navbar-hover #app-navbar .navbar {
    transform: translateY(0);
  }
}

/* Mobile: always show header */
@media (max-width: 768px) {
  .welcome-page #app-navbar .navbar {
    transform: none !important;
  }
}

/* Hide scroll hint when header is scrolled on welcome page */
.welcome-page.header-scrolled .hero-scroll-hint {
  opacity: 0;
  pointer-events: none;
}

.welcome-main {
  width: 100%;
}

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  overflow: hidden;
}

.hero-aurora-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0.3;
  z-index: 0;
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2xl);
  width: 100%;
  text-align: center;
}

.hero-brand-block {
  display: inline-block;
  text-align: center;
  margin: 0;
  padding: 0;
}

.hero-brand-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  margin: 0 0 var(--spacing-sm) 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.05em;
  line-height: 0.95;
}

.hero-brand-title-text {
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  font-weight: 300;
  margin: 0;
  display: block;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
  /* JS установит width и letter-spacing */
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-actions {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.6s forwards;
}

.btn-hero-violet,
.btn-hero-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-hero-violet {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
}

.btn-hero-violet:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-hero-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-hero-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  text-decoration: none;
  animation: bounce 2s infinite;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.hero-scroll-hint .material-icons-outlined {
  font-size: 2.5rem;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Hide all section scroll hints - only show the main hero one */
.section-scroll-hint {
  display: none !important;
}

/* Hide hero scroll hint on non-welcome pages and when scrolled */
body:not(.welcome-page) .hero-scroll-hint {
  display: none;
}

.about-section {
  padding: var(--spacing-2xl) var(--spacing-lg);
  background: var(--bg-secondary);
  position: relative;
}

.about-container {
  max-width: 1000px;
  margin: 0 auto;
}

.about-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.about-lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.wave-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  width: 100%;
  height: 40px;
  display: block;
}

.wave-divider-top {
  margin-bottom: var(--spacing-xl);
}

.reveal-text {
  opacity: 1;
}

.reveal-line {
  display: inline-block;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  /* Navbar at bottom, full width with side margins */
  body:not(.has-admin-sidebar) .navbar,
  body:not(.has-admin-sidebar) .navbar.dynamic-island {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 1rem 1rem 1rem !important;
    width: calc(100% - 2rem) !important;
    max-width: none !important;
    transform: none !important;
    border-radius: 1.5rem !important;
  }
  
  .welcome-page .navbar,
  .welcome-page .navbar.dynamic-island {
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: calc(100% - 2rem) !important;
    transform: none !important;
  }

  .navbar-menu {
    display: none;
  }

  .navbar-actions .btn:not(.navbar-logout-btn) {
    display: none;
  }

  /* Mobile: show only avatar in header profile */
  .navbar-user #user-info,
  .navbar-user .text-sm,
  .navbar-user .navbar-logout-btn {
    display: none !important;
  }
  .navbar-user {
    padding: 0.25rem;
  }
  .navbar-user .navbar-avatar {
    margin: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Welcome mobile: padding and scroll hint */
  .welcome-page .hero-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .welcome-page .hero-actions {
    justify-content: center;
    width: 100%;
  }
  
  .welcome-page .hero-actions .btn-hero-violet,
  .welcome-page .hero-actions .btn-hero-outline {
    margin-left: auto;
    margin-right: auto;
  }
  
  .welcome-page .hero-scroll-hint {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(0);
    bottom: 5rem;
  }

  /* Non-welcome: no top padding on mobile (navbar is at bottom) */
  body:not(.welcome-page) {
    padding-top: 0;
    padding-bottom: 5rem;
  }

  .site-footer {
    padding: 2rem 1rem max(3rem, calc(2rem + env(safe-area-inset-bottom, 0px))) 1rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
    padding: 0 0.5rem;
  }

  .footer-brand {
    flex-direction: column;
    gap: 0.375rem;
    text-align: center;
  }

  .footer-brand-name {
    font-size: 1.125rem !important;
  }

  .footer-brand-copyright {
    font-size: 0.8125rem !important;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.875rem !important;
  }

  .footer-link {
    font-size: 0.875rem !important;
  }

  .footer-social-link {
    width: 36px;
    height: 36px;
  }

  .faq-title {
    font-size: 1.375rem;
  }

  .faq-subtitle {
    font-size: 1rem;
  }

  .faq-item summary {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .faq-content {
    padding: 0 1rem 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero-violet,
  .btn-hero-outline {
    width: 100%;
    max-width: 300px;
  }
}

/* === Desktop adjustments for unified block === */
@media (min-width: 769px) {
  /* Hide these features on desktop - they appear in Features section below */
  .unified-feature-updates,
  .unified-feature-vless,
  .unified-feature-nologs {
    display: none;
  }
  
  /* Desktop: умеренное расстояние между буквами заголовка */
  .hero-brand-title {
    font-size: clamp(4.5rem, 11vw, 8.5rem);
    letter-spacing: 0.1em;
  }

  .hero-subtitle {
    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  }

  /* Desktop: компактная секция "Готовы стать свободнее" */
  .join-section {
    min-height: auto;
    padding: var(--spacing-3xl) var(--spacing-2xl);
  }
}

/* Mobile: компактные заголовки */
@media (max-width: 768px) {
  .hero-brand-title {
    font-size: clamp(2rem, 10vw, 3rem);
    letter-spacing: 0.03em;
  }

  .hero-subtitle {
    font-size: clamp(0.75rem, 3vw, 1rem);
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-weight: 300;
  }

  .hero-brand-block {
    max-width: 95%;
  }

  .hero-actions {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* ============================================
   Custom Checkbox
   ============================================ */
.custom-checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: var(--spacing-sm) 0;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-mark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: transparent;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-checkbox:hover .checkbox-mark {
  border-color: var(--primary-color);
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-mark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-mark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-mark:after {
  display: block;
}

.custom-checkbox input[type="checkbox"]:disabled ~ .checkbox-mark {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Custom Radio Buttons
   ============================================ */
.custom-radio {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.custom-radio:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
}

.custom-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-mark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: transparent;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-radio:hover .radio-mark {
  border-color: var(--primary-color);
}

.custom-radio input[type="radio"]:checked ~ .radio-mark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.radio-mark:after {
  content: "";
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.custom-radio input[type="radio"]:checked ~ .radio-mark:after {
  display: block;
}

.custom-radio input[type="radio"]:disabled ~ .radio-mark {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Tariff Cards Styles
   ============================================ */
/* Бейдж тарифа в таблице пользователей (логин + коронка) */
.tariff-badge-inline {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary-color);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.15);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.tariff-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  border: 2px solid transparent;
  overflow: hidden;
}

.tariff-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Цвета карточек */
.tariff-card-blue {
  border-color: #3b82f6;
}

.tariff-card-orange {
  border-color: #f97316;
}

.tariff-card-green {
  border-color: #10b981;
}

.tariff-card-purple {
  border-color: #8b5cf6;
}

/* Статус-бейдж вверху от края до края */
.tariff-status-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.badge-visible {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.badge-hidden {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.badge-disabled {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

/* Кастомный бейдж */
.tariff-custom-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin-top: var(--spacing-lg);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.tariff-card-header {
  margin-top: var(--spacing-lg);
}

.tariff-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Контейнер цены со скидкой */
.tariff-card-price-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.tariff-card-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.tariff-card-old-price {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}

.tariff-card-discount {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.tariff-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 2.5em;
}

.tariff-card-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.tariff-card-detail {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.tariff-card-detail .material-icons {
  font-size: 18px;
  color: var(--primary-color);
}

.tariff-card-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: auto;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

/* Pricing page styles */
.pricing-tariff-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  border: 2px solid transparent;
  overflow: hidden;
  text-align: center;
}

.pricing-tariff-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Цвета для pricing */
.pricing-tariff-card-blue {
  border-color: #3b82f6;
}

.pricing-tariff-card-blue .pricing-custom-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.pricing-tariff-card-orange {
  border-color: #f97316;
}

.pricing-tariff-card-orange .pricing-custom-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.pricing-tariff-card-green {
  border-color: #10b981;
}

.pricing-tariff-card-green .pricing-custom-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pricing-tariff-card-purple {
  border-color: #8b5cf6;
}

.pricing-tariff-card-purple .pricing-custom-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Бейдж для pricing */
.pricing-custom-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-sm) var(--spacing-md);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.pricing-tariff-header {
  margin-top: var(--spacing-md);
}

.pricing-tariff-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-md) 0;
}

.pricing-tariff-price-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin: var(--spacing-md) 0;
}

.pricing-tariff-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.pricing-tariff-old-price {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}

.pricing-tariff-discount {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pricing-tariff-duration {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
}

.pricing-tariff-features {
  list-style: none;
  padding: 0;
  margin: var(--spacing-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  text-align: left;
}

.pricing-tariff-feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pricing-tariff-feature .material-icons {
  font-size: 18px;
  color: var(--success-color);
}