/* Custom Font Loading */
@font-face {
  font-family: 'Airfool';
  src: url('./assets/Airfool.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Core Design Tokens */
:root {
  --bg-color: #f7f9fc;
  --text-color: #1e1b4b; /* Deep indigo/navy text */
  --text-secondary: #4f46e5; /* Indigo */
  --text-muted: #64748b; /* Slate gray */
  
  /* Harmonious Colors */
  --primary-blue: #0ea5e9;
  --primary-blue-hover: #0284c7;
  --accent-green: #10b981; /* Bubbly emerald green */
  --accent-green-hover: #059669;
  --accent-purple: #8b5cf6; /* Soft lavender/purple */
  --accent-purple-hover: #7c3aed;
  --error-pink: #f43f5e;
  
  /* Glassmorphism Panel styles - Lighter and Airy */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: rgba(31, 38, 135, 0.05);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-buttons: 'Airfool', 'Outfit', sans-serif;
}

/* Basic Reset & Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
}

body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-color);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive Full-Screen Background Image */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2; /* Placed on top of the gradient overlay */
  background-image: url('./assets/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.16; /* Low opacity lets the stars blend into the light gradient */
  filter: brightness(1.3) saturate(1.2) contrast(0.9);
}

/* Overlay gradient to smooth background - Soft Pastel Dreamy Cosmic Sky */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -3; /* Placed behind the background image */
  background: linear-gradient(135deg, #e0f2fe 0%, #fdf2f8 45%, #eef2ff 100%);
  pointer-events: none;
}

/* Subtle Neon Glow Highlights in the corners */
.bg-glow {
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  z-index: -2; /* Placed behind the clouds */
  pointer-events: none;
  filter: blur(140px);
  opacity: 0.35;
}

.bg-glow-1 {
  top: -10%;
  left: -10%;
  background: #f472b6; /* Light pink glow */
}

.bg-glow-2 {
  bottom: -10%;
  right: -10%;
  background: #c084fc; /* Light purple/lavender glow */
}

/* Decorative Fluffy Clouds at the bottom (as seen in mockup) */
.clouds-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 280px;
  z-index: -1; /* Placed in front of backgrounds but behind dashboard content */
  pointer-events: none;
  overflow: hidden;
  opacity: 0.95; /* High opacity to make them stand out clearly */
  display: flex;
  justify-content: center;
}

.cloud-bubble {
  position: absolute;
  border-radius: 50%;
  transition: transform 0.5s ease-in-out;
  filter: blur(10px); /* Soft organic edge instead of washing out the entire cloud shape */
  box-shadow: inset 0 -10px 25px rgba(255, 255, 255, 0.6), 0 -8px 24px rgba(167, 139, 250, 0.12);
}

.bubble-1 {
  width: 500px;
  height: 250px;
  bottom: -60px;
  left: -120px;
  background: linear-gradient(135deg, #fbcfe8 0%, #c7d2fe 100%); /* Cotton-candy pink to lavender */
  animation: floatCloud1 16s ease-in-out infinite alternate;
}

.bubble-2 {
  width: 600px;
  height: 300px;
  bottom: -90px;
  right: -140px;
  background: linear-gradient(135deg, #c7d2fe 0%, #e0f2fe 100%); /* Lavender to sky blue */
  animation: floatCloud2 20s ease-in-out infinite alternate;
}

.bubble-3 {
  width: 400px;
  height: 220px;
  bottom: -40px;
  left: 15%;
  background: linear-gradient(135deg, #fbcfe8 0%, #e0f2fe 100%); /* Soft pink to sky blue */
  animation: floatCloud3 14s ease-in-out infinite alternate;
}

.bubble-4 {
  width: 460px;
  height: 240px;
  bottom: -70px;
  right: 15%;
  background: linear-gradient(135deg, #e0f2fe 0%, #fbcfe8 100%); /* Sky blue to cotton-candy pink */
  animation: floatCloud4 18s ease-in-out infinite alternate;
}

/* Clouds float animations */
@keyframes floatCloud1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(15px, -10px) scale(1.05); }
}

@keyframes floatCloud2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20px, -8px) scale(0.98); }
}

@keyframes floatCloud3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8px, -15px) scale(1.03); }
}

@keyframes floatCloud4 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10px, -12px) scale(1.02); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Shell Layout Containers */
.app-container {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Views & Screens toggles */
.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.3s ease-out forwards;
}

.screen.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Glassmorphism card panel */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 32px var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 36px rgba(31, 38, 135, 0.08);
}

/* --- AUTHENTICATION SCREEN --- */
.auth-card {
  width: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.logo-container {
  text-align: center;
  margin-bottom: 8px;
}

.app-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.15);
  margin-bottom: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: logoFloat 4s ease-in-out infinite;
}

.app-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-family: var(--font-buttons);
  font-size: 14px;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
}

.auth-tab.active {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.auth-tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.auth-tab-content.active {
  display: flex;
}

#email-step-input,
#email-step-code {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 300;
}

.text-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}
.text-link:hover {
  text-decoration: underline;
}

.code-span {
  background: rgba(15, 23, 42, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  color: var(--accent-purple);
}

/* Input Fields Styles */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.input-group input {
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text-color);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.input-group input:focus {
  background: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
}

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

.auth-actions {
  display: flex;
  gap: 12px;
}

.auth-actions button {
  flex: 1;
}

/* Action Buttons using Airfool Font */
.action-btn {
  font-family: var(--font-buttons);
  font-size: 15px;
  padding: 15px;
  border: none;
  outline: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-transform: capitalize;
  letter-spacing: 1px;
}

.primary-btn {
  background: var(--primary-blue);
  color: #ffffff; /* White text for clear contrast in light mode */
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
}
.primary-btn:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}
.primary-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.secondary-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-color);
}

.error-msg {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.15);
  color: #e11d48;
  font-size: 13px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  animation: shake 0.3s ease-in-out;
}

.hidden {
  display: none !important;
}

/* --- DASHBOARD SCREEN --- */

/* Dashboard Header */
.dashboard-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  margin-bottom: 4px;
}

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

.header-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(31, 38, 135, 0.08);
}

.header-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logout-btn {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.logout-btn:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  transform: scale(1.05);
}
.logout-icon {
  width: 18px;
  height: 18px;
}

/* Donut Profile Card (Unified subscription block) */
.donut-dashboard-card {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 243, 255, 0.75) 100%);
}

.donut-ring-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

/* Pulsating blurred glow behind the ring */
.donut-ring-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary-blue), var(--accent-purple), var(--accent-green), var(--primary-blue));
  filter: blur(16px);
  opacity: 0.45;
  animation: spinGlow 8s linear infinite;
  transition: all 0.5s ease;
}

/* Red glow for expired subscription */
.donut-dashboard-card:has(.expired-badge) .donut-ring-glow {
  background: conic-gradient(from 0deg, var(--error-pink), #fda4af, var(--error-pink));
  opacity: 0.35;
}

.donut-ring {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.9), 0 8px 24px rgba(31, 38, 135, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 4px solid transparent;
  background-clip: padding-box;
}

/* Double border trick for glowing border */
.donut-ring::before {
  content: '';
  position: absolute;
  top: -4px; bottom: -4px; left: -4px; right: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
  z-index: -1;
  transition: all 0.5s ease;
}

.donut-dashboard-card:has(.expired-badge) .donut-ring::before {
  background: linear-gradient(135deg, var(--error-pink), #fda4af);
}

.donut-days {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.1;
}

.donut-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.donut-info-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.user-id-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 6px 12px;
  border-radius: 12px;
}

.id-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.user-id-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.5px;
}

.copy-id-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.copy-id-btn:hover {
  color: var(--text-color);
  background: rgba(15, 23, 42, 0.05);
}

/* Subscription Status badge (pulsing green) */
.badge {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  text-align: center;
  letter-spacing: 0.5px;
}

.active-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  position: relative;
  overflow: hidden;
}

.active-badge::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: inherit;
  border-radius: inherit;
  z-index: -1;
  animation: badgePulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.expired-badge {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #e11d48;
}

/* Custom Styled Select Dropdown & Key block in a unified card */
.connection-card {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 243, 255, 0.75) 100%);
}

.connection-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.location-icon-wrapper {
  width: 38px;
  height: 38px;
  background: rgba(14, 165, 233, 0.08);
  color: var(--primary-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.connection-card:hover .location-icon-wrapper {
  transform: rotate(15deg);
}

.location-icon {
  width: 20px;
  height: 20px;
}

.custom-select-wrapper {
  position: relative;
  flex: 1;
}

.node-select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  color: var(--text-color);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 30px 8px 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.node-select:focus + .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.node-select option {
  background: #ffffff;
  color: var(--text-color);
  font-weight: 400;
  padding: 12px;
}

.card-divider-thin {
  width: 100%;
  height: 1px;
  background: rgba(15, 23, 42, 0.04);
}

/* Key display & actions row */
.key-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.key-text-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  height: 42px;
  min-width: 0; /* allows child overflow truncation */
  transition: border-color 0.2s ease;
}

.key-text-wrapper:focus-within {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.5);
}

.key-status-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.vless-single-line {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 12px;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding: 0;
}

.key-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-action-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.icon-action-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.icon-action-btn:hover {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.icon-action-btn:active {
  transform: translateY(1px);
}

/* QR Code inline box styling */
.qr-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  animation: qrSlideDown 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(31, 38, 135, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-wrapper img {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

.qr-description {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 200px;
  line-height: 1.4;
}

/* Deep link buttons below connection info */
.app-links-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.app-btn {
  flex: 1;
  font-family: var(--font-buttons);
  font-size: 13px;
  padding: 13px;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: 0.5px;
  gap: 8px;
}

.app-btn svg {
  width: 16px;
  height: 16px;
}

.v2ray-btn {
  background: var(--accent-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.v2ray-btn:hover {
  background: var(--accent-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.happ-btn {
  background: var(--accent-purple);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}
.happ-btn:hover {
  background: var(--accent-purple-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.25);
}

.app-btn:active {
  transform: translateY(1px);
}

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

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

/* Toast Notification (Popup message) */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1e1b4b; /* Navy dark background so it pops on light screen */
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.18);
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  opacity: 1;
  text-align: center;
  white-space: nowrap;
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(15px);
  display: none !important;
}

/* Spinner Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(224, 242, 254, 0.65); /* Light blue glass */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.25s ease-out forwards;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(15, 23, 42, 0.05);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes badgePulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- WELCOME / ONBOARDING SCREEN --- */
.welcome-card {
  width: 100%;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}

.welcome-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.welcome-logo-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.welcome-logo-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, rgba(139, 92, 246, 0) 70%);
  filter: blur(8px);
  animation: logoPulse 4s ease-in-out infinite;
}

.welcome-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  animation: welcomeLogoFloat 5s ease-in-out infinite;
  z-index: 1;
}

.welcome-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 280px;
  line-height: 1.5;
}

.welcome-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-btn {
  text-transform: none !important;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  border-radius: 16px;
  padding: 16px;
  gap: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.welcome-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.welcome-btn:hover svg {
  transform: scale(1.1) rotate(-4deg);
}

.tg-btn {
  background: linear-gradient(135deg, #24A1DE 0%, #0088cc 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(36, 161, 222, 0.25);
  border: none;
}

.tg-btn:hover {
  background: linear-gradient(135deg, #2ab0f0 0%, #0099e6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(36, 161, 222, 0.35);
}

.email-btn {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-color);
  border: 1.5px solid rgba(15, 23, 42, 0.08);
}

.email-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

/* Auth back button styles */
.auth-back-container {
  display: flex;
  margin-bottom: -8px;
}

.auth-back-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.auth-back-btn:hover {
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.04);
}

.auth-back-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.auth-back-btn:hover svg {
  transform: translateX(-2px);
}

/* Additional Onboarding Animations */
@keyframes welcomeLogoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

/* --- SUBSCRIPTION PAYMENT SCREEN STYLES --- */

/* Pending Payment Status Banner */
.payment-pending-status {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9) 0%, rgba(253, 230, 138, 0.8) 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.05);
  margin-bottom: 4px;
}

.pending-icon-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spinner-small {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(217, 119, 6, 0.1);
  border-top-color: #d97706;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.pending-text-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pending-title {
  font-size: 14px;
  font-weight: 700;
  color: #b45309;
}

.pending-desc {
  font-size: 11px;
  line-height: 1.4;
  color: #d97706;
}

.pending-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.pending-action-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pending-action-btn:active {
  transform: translateY(1px);
}

.retry-btn {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.retry-btn:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-1px);
}

.check-btn {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
}

.check-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.cancel-btn {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  border-color: rgba(15, 23, 42, 0.08);
}

.cancel-btn:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  transform: translateY(-1px);
}

/* Payment Card styling */
.payment-card {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 243, 255, 0.75) 100%);
}

.payment-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0.5px;
}

.payment-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Tariff list and items */
.tariffs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.tariffs-loading {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 20px 0;
}

.tariff-item {
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.tariff-item:hover {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
}

.tariff-item.selected {
  background: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.12);
}

.tariff-item.selected::before {
  content: '';
  position: absolute;
  top: -1.5px; bottom: -1.5px; left: -1.5px; right: -1.5px;
  border-radius: 18px;
  border: 1.5px solid var(--primary-blue);
  pointer-events: none;
  animation: borderGlowPulse 2s infinite;
}

.tariff-info-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tariff-duration {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
}

.tariff-monthly-rate {
  font-size: 12px;
  color: var(--text-muted);
}

.tariff-info-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.tariff-total-price {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tariff-badge {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-purple-hover);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.payment-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pay-submit-btn {
  margin-top: 8px;
}

.pay-submit-btn:disabled {
  background: rgba(15, 23, 42, 0.1);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none !important;
}

@keyframes borderGlowPulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(14, 165, 233, 0.2);
  }
  50% {
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
  }
}

