@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: #0B0910;
  --purple: #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark: #6D3FE0;
  --text: #F0EEF7;
  --text-muted: #9691AC;
  --white: #1D1930;
  --danger: #F87171;
  --card: #17141F;
  --card-border: rgba(255,255,255,0.07);
  --input-bg: #201C29;
  --input-border: rgba(255,255,255,0.09);
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
  --radius: 16px;
  --radius-sm: 10px;
}

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;
  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(120px);
  opacity: 0.28;
}
.orb1 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, #6D3FE0, transparent 70%);
  top: -260px; left: 50%;
  transform: translateX(-60%);
  animation: drift1 16s ease-in-out infinite;
}
.orb2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #4C2A9E, transparent 70%);
  bottom: -280px; right: -140px;
  animation: drift2 20s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translateX(-60%) translateY(0); }
  50% { transform: translateX(-60%) translateY(24px); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(-24px, -20px); }
}

.id-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  width: 100%;
}

.id-header-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.lang-select { position: relative; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--purple-light);
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}
.lang-btn:hover { color: var(--text); }
.lang-chevron { transition: transform 0.2s ease; }
.lang-select.open .lang-chevron,
.lang-btn[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  background: #1B1826;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
}
.lang-dropdown.open { display: flex; flex-direction: column; gap: 2px; }

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-option:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.lang-option.active { color: var(--purple-light); }
.lang-option.active::after {
  content: "✓";
  font-size: 12px;
}

.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: 13px 20px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-auth:hover {
  border-color: rgba(255,255,255,0.18);
  background: #262130;
}
.btn-auth:active { transform: translateY(0); }

.hidden { display: none !important; }

.auth-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 66px);
  justify-content: center;
  animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

.auth-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.auth-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 27px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-label:not(:first-child) { margin-top: 14px; }

.nx-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.nx-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
.nx-input::placeholder { color: var(--text-muted); }

.password-wrap { position: relative; }
.password-wrap .nx-input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s;
}
.password-toggle:hover { color: var(--purple); }

.auth-remember {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 6px;
  cursor: pointer;
}
.auth-remember input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--purple);
  cursor: pointer;
  flex-shrink: 0;
}
.auth-remember-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-remember-title {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
}
.auth-remember-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-block { width: 100%; }

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 20px;
}
.auth-switch a {
  color: var(--purple-light);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-help {
  text-align: center;
  margin-top: 22px;
}
.hr-divider {
  height: 1px;
  background: var(--card-border);
  margin-bottom: 18px;
}
.auth-help-link {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}
.auth-help-link:hover { color: var(--purple-light); text-decoration: underline; }

.form-success {
  font-size: 13px;
  color: #4ADE80;
  min-height: 18px;
  font-weight: 500;
  text-align: left;
}

.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; }
  .auth-card { padding: 28px 22px; }
  .auth-wrap { padding: 12px 18px 40px; }
  .id-header { padding: 18px 18px; }
  .lang-dropdown { min-width: 130px; }
}

.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; }
