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

:root {
  --bg-page: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 16px 40px rgba(107, 33, 168, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03);
  --card-border: rgba(226, 232, 240, 0.6);
  
  --primary: #6b21a8;
  --primary-hover: #581c87;
  --primary-light: #f3e8ff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  
  --font-base: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-base); }

body { 
  background-color: #e2e8f0; 
  color: var(--text-main); 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased; 
  display: flex; 
  justify-content: center; 
  min-height: 100vh; 
}

.app-container { 
  width: 100%; 
  max-width: 480px; 
  min-height: 100vh; 
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  position: relative; 
  overflow-x: hidden; 
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.1); 
  display: flex; 
  flex-direction: column;
}

.view { display: none; padding: 32px 24px; flex: 1; animation: slideInFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.view.active { display: block; }
.hidden { display: none !important; }

.text-center { text-align: center; } .text-left { text-align: left; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } 
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mb-2 { margin-bottom: 8px; } 
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .pb-10 { padding-bottom: 40px; } 
.w-full { width: 100%; } .flex-between { display: flex; justify-content: space-between; align-items: center; }

h1, h2, h3, .title-xl, .title-lg, .title-md { font-family: var(--font-display); letter-spacing: -0.02em; }
.title-xl { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.title-lg { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.title-md { font-size: 1.25rem; font-weight: 600; }
.text-lg { font-size: 1.1rem; } .text-sm { font-size: 0.875rem; } .text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; } .font-bold { font-weight: 700; }

.text-muted { color: var(--text-muted); font-weight: 400; } 
.text-primary { color: var(--primary); }
.text-success { color: var(--success); } 
.text-danger { color: var(--danger); }
.text-gold { color: var(--gold); }

.clean-card { 
  background: var(--card-bg); 
  border: 1px solid var(--card-border); 
  border-radius: var(--radius-md); 
  padding: 24px; 
  box-shadow: var(--card-shadow); 
  backdrop-filter: blur(10px);
}

.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 10px; 
  padding: 16px 24px; 
  border-radius: var(--radius-sm); 
  font-family: var(--font-display);
  font-weight: 700; 
  font-size: 1.05rem; 
  border: none; 
  cursor: pointer; 
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
}
.btn:active { transform: scale(0.96); box-shadow: none !important; }
.btn-primary { 
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); 
  color: white; 
  box-shadow: 0 12px 28px rgba(107, 33, 168, 0.3); 
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  box-shadow: 0 16px 32px rgba(107, 33, 168, 0.4); 
  transform: translateY(-2px);
}
.btn-danger { 
  background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%); 
  color: white; 
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.3); 
}
.btn-secondary { background: var(--primary-light); color: var(--primary); font-weight: 600; box-shadow: 0 4px 12px rgba(243, 232, 255, 1); }
.btn-primary-ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); box-shadow: 0 4px 12px rgba(107, 33, 168, 0.1); }
.btn-outline { background: transparent; border: 2px solid #cbd5e1; color: var(--text-main); }

header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 16px 24px; 
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border); 
  position: sticky; 
  top: 0; 
  z-index: 10; 
  box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
}
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; display: flex; align-items: center; gap: 8px; color: var(--text-main); letter-spacing: -0.03em;}
.logo i { color: var(--primary); font-size: 1.6rem; filter: drop-shadow(0 2px 4px rgba(107,33,168,0.3));}
.user-pill { 
  display: flex; align-items: center; gap: 10px; 
  background: white; border: 1px solid var(--card-border); padding: 6px 16px 6px 6px; 
  border-radius: 40px; font-size: 0.9rem; font-weight: 600; transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.user-pill:active { transform: scale(0.96); }
.avatar { background: var(--primary-light); color: var(--primary); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

.user-menu { 
  position:absolute; top: 76px; right: 24px; 
  background: rgba(255,255,255,0.95); backdrop-filter: blur(16px);
  padding: 24px; border-radius: var(--radius-md); 
  box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05); 
  z-index: 50; width: 300px; 
  animation: scaleMenu 0.25s cubic-bezier(0.16,1,0.3,1) forwards; 
  transform-origin: top right;
}
@keyframes scaleMenu { from { opacity: 0; transform: scale(0.9) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.user-menu hr { border: none; border-top: 1px solid var(--card-border); margin: 16px 0; }
.user-menu .badge-verified { background: var(--success-light); color: var(--success); font-size:0.75rem; font-weight:bold; display:inline-flex; align-items:center; gap:6px; padding: 6px 12px; border-radius:12px; margin-top:8px;}
.menu-details div { font-size: 0.9rem; color: var(--text-main); margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-size: 1rem; color: var(--text-main); font-weight: 500; cursor: pointer; transition: 0.2s; }
.menu-item:hover { color: var(--primary); transform: translateX(4px); }
.menu-item i { font-size: 1.3rem; color: var(--text-muted); }
.menu-item:hover i { color: var(--primary); }

.tabs { display: flex; padding: 6px; background: rgba(226, 232, 240, 0.7); backdrop-filter: blur(4px); border-radius: var(--radius-sm); gap: 6px; }
.tab-btn { flex: 1; text-align: center; padding: 12px 0; border-radius: 8px; border: none; background: transparent; font-weight: 600; font-size: 0.95rem; color: var(--text-muted); cursor: pointer; transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.tab-badge { background: #cbd5e1; color: white; padding: 4px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;}
.tab-btn.active .tab-badge { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(107,33,168,0.3); }

.task-card { 
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; 
  padding: 24px; background: white; border: 1px solid var(--card-border); 
  border-radius: var(--radius-md); margin-bottom: 16px; 
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
  cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
}
.task-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 16px 40px rgba(107,33,168,0.08); border-color: var(--primary-light); }
.task-info { flex: 1; min-width: 200px; }
.task-info h4 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--text-main); line-height: 1.3;}
.task-info p { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.task-reward { 
  background: var(--primary-light); color: var(--primary); 
  padding: 10px 18px; border-radius: 30px; font-weight: 800; font-size: 1.1rem; 
  border: 1px solid rgba(107,33,168,0.1); font-family: var(--font-display);
}
.task-card.completed { opacity: 0.6; filter: grayscale(1); pointer-events: none; transform: none; box-shadow: none; border: 1px dashed #cbd5e1; }
.task-card.completed .task-reward { background: transparent; color: var(--text-muted); border: 1px dashed var(--text-muted); }

.landing-hero { text-align: center; padding: 30px 0 40px; position: relative;}
.landing-hero .badge { display: inline-flex; align-items:center; gap: 8px; background: rgba(16, 185, 129, 0.1); color: var(--success); padding: 8px 18px; border-radius: 30px; font-size: 0.85rem; font-weight: 800; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.5px; border: 1px solid rgba(16, 185, 129, 0.2); }
.feature-list { margin-top: 40px; display: flex; flex-direction: column; gap: 24px; }
.feature-item { display: flex; align-items: flex-start; gap: 20px; text-align: left; background: white; padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--card-border); box-shadow: 0 10px 30px rgba(0,0,0,0.02); transition: 0.3s; }
.feature-item:hover { transform: translateX(5px); box-shadow: 0 10px 30px rgba(107,33,168,0.06); border-color: rgba(107,33,168,0.2) }
.feature-icon { background: linear-gradient(135deg, var(--primary-light) 0%, #e0e7ff 100%); color: var(--primary); width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex-shrink: 0; box-shadow: inset 0 2px 4px rgba(255,255,255,0.5); }
.feature-text h4 { font-family: var(--font-display); font-size: 1.15rem; color: var(--text-main); margin-bottom: 6px; font-weight: 700;}
.feature-text p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5;}

.form-group { margin-bottom: 20px; display: flex; flex-direction: column; }
.form-group label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-display); }
.form-group input, .form-group select { background: #f8fafc; border: 2px solid #e2e8f0; border-radius: var(--radius-sm); padding: 16px; color: var(--text-main); font-size: 1.05rem; font-weight: 500; transition: all 0.25s; box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.01); }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 4px var(--primary-light); }

.balance-card { text-align: center; background: white; border-radius: var(--radius-lg); padding: 40px 24px; border: 1px solid var(--card-border); box-shadow: 0 20px 50px rgba(107, 33, 168, 0.08); position: relative; overflow: hidden; }
.balance-card::before { content: ""; position:absolute; top:0; left:0; right:0; height:4px; background: linear-gradient(90deg, var(--primary), #ec4899); }
.balance-label { font-size: 0.95rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.balance-value { font-family: var(--font-display); font-size: 3.8rem; font-weight: 800; color: var(--text-main); margin: 12px 0; letter-spacing: -0.04em; display:flex; align-items:baseline; justify-content:center; gap:8px; text-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.progress-container { width: 100%; height: 12px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-top: 16px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary) 0%, #ec4899 100%); border-radius: 6px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); position: relative; }
.progress-bar::after { content: ""; position:absolute; top:0; left:0; right:0; bottom:0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); animation: shimmer 2s infinite; }

@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.instruction-badge { background: var(--primary-light); border: 1px solid rgba(107,33,168,0.2); padding: 16px; border-radius: var(--radius-sm); display: flex; gap: 14px; align-items:flex-start; font-size:0.95rem; font-weight: 500; color: var(--primary); margin-bottom: 24px; box-shadow: 0 4px 12px rgba(107,33,168,0.05); }
.instruction-badge i { font-size: 1.4rem; margin-top:2px; }
.phrase-card { background: white; padding: 32px 24px; border-radius: var(--radius-md); font-size: 1.25rem; font-weight: 500; line-height: 1.6; text-align: center; color: var(--text-main); border: 2px solid #e2e8f0; position: relative; font-family: var(--font-base); letter-spacing: -0.01em; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);}
.recorder-section { display: flex; flex-direction: column; align-items: center; margin-top: 40px; }

.mic-wrapper { position: relative; display: flex; justify-content: center; align-items: center; }
.mic-button { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, #4c1d95 100%); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: white; cursor: pointer; box-shadow: 0 16px 40px rgba(79, 70, 229, 0.4), inset 0 4px 10px rgba(255,255,255,0.2); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); border: none; outline: none; z-index: 2; }
.mic-button:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 20px 50px rgba(79, 70, 229, 0.5), inset 0 4px 10px rgba(255,255,255,0.2); }
.mic-button:active { transform: scale(0.95); }
.mic-button.recording { animation: pulseRec 1.5s infinite; background: linear-gradient(135deg, var(--danger) 0%, #991b1b 100%); box-shadow: 0 16px 40px rgba(239, 68, 68, 0.5); }

@keyframes pulseRec {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 25px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.audio-preview { width: 100%; margin-top: 24px; border-radius: 40px; border: 1px solid var(--card-border); background: var(--bg-page); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; animation: fadeInModal 0.3s forwards; }
.modal-content { width: 100%; max-width: 480px; margin: 0 auto; background: white; border-radius: var(--radius-lg); padding: 40px 24px; position: relative; box-shadow: 0 25px 60px rgba(0,0,0,0.25); animation: zoomInFull 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform-origin: center; }
.close-modal { position: absolute; top: 24px; right: 24px; background: #f1f5f9; border: none; width: 36px; height: 36px; border-radius: 50%; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-modal:hover { background: #e2e8f0; color: var(--danger); transform: rotate(90deg); }

@keyframes fadeInModal { from { background: rgba(15, 23, 42, 0); backdrop-filter: blur(0px); } to { background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(8px); } }
@keyframes zoomInFull { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.result-box { background: linear-gradient(135deg, var(--success-light) 0%, #f0fdf4 100%); border: 1px solid #6ee7b7; padding: 24px; border-radius: var(--radius-md); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05); }
.result-item { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 1.05rem; font-weight: 600; color: #065f46; border-bottom: 1px dashed rgba(16,185,129,0.3); padding-bottom: 14px;}
.result-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.result-item i { font-size: 1.4rem; color: var(--success); }

.feedback-stats { background: white; border: 1px solid var(--card-border); padding: 16px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);}
.feedback-item { display: flex; justify-content: space-between; border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px; font-weight: 500; color: var(--text-main); }
.feedback-item:last-child { border-bottom: none; padding-bottom: 0; margin-bottom:0;}

.plan-card { 
  background: white; border: 1px solid var(--card-border); 
  border-radius: var(--radius-lg); padding: 40px 24px 32px; 
  position: relative; margin-bottom: 24px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.04); overflow: hidden; 
  transition: transform 0.3s;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }

.plan-card.highlight { 
  border: 2px solid var(--primary); 
  box-shadow: 0 20px 50px rgba(107,33,168,0.15); 
  transform: scale(1.02);
  z-index: 5;
}
.plan-card.highlight::before {
  content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(45deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 60%);
  transform: rotate(30deg); animation: premiumShine 6s infinite; z-index: 1; pointer-events: none;
}
@keyframes premiumShine { 0% { transform: translateX(-100%) rotate(30deg); } 100% { transform: translateX(100%) rotate(30deg); } }

.plan-badge { 
  position: absolute; top: 0; left: 0; width: 100%; 
  background: linear-gradient(90deg, var(--primary) 0%, #ec4899 100%); 
  color: white; text-align: center; font-size: 0.85rem; font-weight: 800; font-family: var(--font-display);
  padding: 8px 0; letter-spacing: 2px; text-transform: uppercase; z-index: 2;
  box-shadow: 0 4px 10px rgba(107,33,168,0.3);
}

.plan-header { border-bottom: 1px dashed var(--card-border); padding-bottom: 24px; margin-bottom: 24px; text-align:center; position:relative; z-index:2; }
.plan-header h3 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 8px; font-weight:800; }
.plan-price { font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.05em; display:flex; align-items:baseline; justify-content:center; gap:4px; }
.plan-price span { font-size: 1rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 16px; position:relative; z-index:2;}
.plan-features li { display: flex; align-items: flex-start; gap: 12px; font-size: 1rem; color: var(--text-main); font-weight:500; }
.plan-features li i { color: var(--success); font-size: 1.4rem; margin-top: 2px; filter: drop-shadow(0 2px 4px rgba(16,185,129,0.2)); }

.error-banner { background: var(--danger-light); color: #991b1b; padding: 16px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; margin-top: 20px; border: 1px solid #fca5a5; display: flex; gap: 12px; align-items:center; box-shadow: 0 4px 12px rgba(239,68,68,0.1); }
.error-banner i { font-size: 1.4rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity:0;} to { transform: translateY(0); opacity:1;} }
@keyframes slideInFade { 0% { opacity: 0; transform: translateY(15px) scale(0.98); } 100% { opacity: 1; transform: none; } }

.spinner { width: 44px; height: 44px; border: 4px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
