@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #14111F;
  --purple: #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark: #6D3FE0;
  --text: #F0EEF7;
  --text-muted: #9691AC;
  --white: #1D1930;
  --danger: #F87171;
  --card: rgba(29,25,48,0.7);
  --card-border: rgba(139,92,246,0.18);
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  font-family: 'Satoshi', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

#screen-login {
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
}
.orb1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #9B7FF6, #6B3FF0);
  top: -180px; left: -120px;
  animation: drift1 12s ease-in-out infinite;
}
.orb2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, #C4B5FD, #7C3AED);
  bottom: -120px; right: -100px;
  animation: drift2 15s ease-in-out infinite;
}
.orb3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #DDD6FE, #A78BFA);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: drift3 18s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(40px, 30px); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(-30px, -40px); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-50%) scale(1.15); }
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

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

.login-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 32px;
}

.login-headline {
  font-family: 'Clash Display', sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--purple);
  line-height: 1.15;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 20px;
  background: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.btn-auth:hover {
  box-shadow: 0 6px 24px rgba(107,63,240,0.18);
  transform: translateY(-2px);
}
.btn-auth:active { transform: translateY(0); }

.email-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
  animation: fadeUp 0.3s ease both;
}
.email-form.visible { display: flex; }

.nx-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}
.nx-input:focus { box-shadow: 0 0 0 2px var(--purple), 0 2px 12px rgba(0,0,0,0.06); }
.nx-input::placeholder { color: var(--text-muted); }

.email-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-primary {
  flex: 1;
  padding: 14px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(107,63,240,0.3);
}
.btn-primary:hover {
  background: var(--purple-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(107,63,240,0.4);
}

.btn-ghost {
  flex: 1;
  padding: 14px;
  background: var(--white);
  color: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.btn-ghost:hover {
  box-shadow: 0 4px 16px rgba(107,63,240,0.15);
  transform: translateY(-1px);
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  font-weight: 500;
  text-align: left;
}

#screen-dashboard {
  flex-direction: column;
  min-height: 100vh;
}

.nx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(29,25,48,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(107,63,240,0.1);
}

.nx-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.header-brand {
  font-family: 'Clash Display', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: -0.3px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.dashboard {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeUp 0.5s cubic-bezier(0.22,1,0.36,1) both;
}

.dash-section { display: flex; flex-direction: column; gap: 14px; }

.section-header { display: flex; align-items: baseline; gap: 10px; }
.section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: -0.3px;
}
.section-sub { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.profile-avatar-lg {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-size: 22px; font-weight: 700; color: white;
  flex-shrink: 0; overflow: hidden;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-info { display: flex; flex-direction: column; gap: 4px; }
.profile-name {
  font-family: 'Clash Display', sans-serif;
  font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.2px;
}
.profile-email { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 4px; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; width: fit-content;
}
.plan-badge.free { background: rgba(107,63,240,0.1); color: var(--purple); }
.plan-badge.pro,
.plan-badge.one { background: linear-gradient(135deg, var(--purple), var(--purple-light)); color: white; }

.sessions-list { display: flex; flex-direction: column; gap: 10px; }
.sessions-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); color: var(--text-muted);
  font-size: 14px; font-weight: 500; text-align: center;
}

.session-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px 18px;
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease both;
}
.session-icon {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden;
  flex-shrink: 0; background: rgba(107,63,240,0.08);
  display: flex; align-items: center; justify-content: center;
}
.session-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.session-info { flex: 1; min-width: 0; }
.session-app { font-size: 15px; font-weight: 700; color: var(--text); font-family: 'Clash Display', sans-serif; }
.session-device { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-close {
  background: none; border: none; color: var(--danger);
  font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; transition: background 0.2s;
  flex-shrink: 0; font-family: 'Satoshi', sans-serif;
}
.session-close:hover { background: rgba(229,62,62,0.08); }

.apps-grid { display: flex; flex-direction: column; gap: 10px; }
.app-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px 18px;
  text-decoration: none; backdrop-filter: blur(12px);
  box-shadow: var(--shadow); transition: all 0.2s ease;
}
.app-card:hover {
  border-color: rgba(107,63,240,0.3);
  box-shadow: var(--shadow-lg); transform: translateY(-2px);
}
.app-icon {
  width: 44px; height: 44px; border-radius: 12px;
  object-fit: contain; background: rgba(107,63,240,0.08);
  padding: 6px; flex-shrink: 0;
}
.app-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.app-name { font-family: 'Clash Display', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); }
.app-desc { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.app-arrow { color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s, color 0.2s; }
.app-card:hover .app-arrow { transform: translateX(3px); color: var(--purple); }

.btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; background: transparent;
  border: 1.5px solid rgba(229,62,62,0.3); border-radius: var(--radius-sm);
  color: var(--danger); font-family: 'Satoshi', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.2s ease; width: fit-content;
}
.btn-danger:hover { background: rgba(229,62,62,0.06); border-color: var(--danger); }

.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2A2440; color: #F0EEF7;
  padding: 12px 22px; border-radius: 40px;
  font-size: 13px; font-weight: 600; font-family: 'Satoshi', sans-serif;
  z-index: 9999; opacity: 0;
  transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap; box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .login-headline { font-size: 28px; }
  .login-logo { width: 100px; }
  .dashboard { padding: 24px 14px 40px; }
  .section-title { font-size: 19px; }
}

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.18s;
  box-shadow: 0 2px 10px rgba(107,63,240,0.3);
}
.btn-upgrade:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-upgrade.hidden { display: none; }
