/* ==========================================================================
   REQUIRES assets/css/tokens.css — every page must link it BEFORE this file:
     <link rel="stylesheet" href="assets/css/tokens.css" />
     <link rel="stylesheet" href="assets/css/login.css" />
   Theme palettes (--bg, --text, --brand, …) live there and are shared with
   style.css and portal.css. Add or change tokens there, not here.
   Linked rather than @import-ed so the two files download in parallel.
   ========================================================================== */

/* Dual-Mode Logo component (separate light and dark logo images) */
.logo-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo-img {
  height: 52px;
  width: auto;
  display: block;
}
.brand-logo-img.sm {
  height: 38px;
}
html[data-theme="dark"] .logo-dark,
:root:not([data-theme="light"]) .logo-dark {
  display: block !important;
}
html[data-theme="dark"] .logo-light,
:root:not([data-theme="light"]) .logo-light {
  display: none !important;
}
html[data-theme="light"] .logo-dark {
  display: none !important;
}
html[data-theme="light"] .logo-light {
  display: block !important;
}

*{box-sizing:border-box}
html{background:var(--bg);color:var(--text)}
html,body{margin:0;padding:0}
body{
  font-family:'Plus Jakarta Sans','Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  background:var(--page-gradient);
  background-attachment:fixed;
  color:var(--text);min-height:100vh;display:grid;place-items:center;padding:24px;
  -webkit-font-smoothing:antialiased;
  position:relative;
  overflow-x:hidden;
}

/* Floating Ambient Orbs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
  animation: floatOrb 20s ease-in-out infinite alternate;
}
body::before {
  width: 500px; height: 500px;
  top: -120px; right: -120px;
  background: var(--orb-1);
}
body::after {
  width: 450px; height: 450px;
  bottom: -120px; left: -120px;
  background: var(--orb-2);
  animation-delay: -10s;
}
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 70px) scale(1.1); }
  100% { transform: translate(60px, -40px) scale(0.92); }
}

a{color:var(--brand);text-decoration:none;transition:color 0.2s ease}

.theme-toggle {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--panel-2);border:1px solid var(--line);
  color:var(--text) !important;padding:0 14px;height:34px;box-sizing:border-box;border-radius:999px;font-size:12.5px;font-weight:600;cursor:pointer;
  font-family:inherit;transition:all 0.25s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;margin-left:auto;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  box-shadow:0 4px 15px -2px rgba(0, 210, 255, 0.15), inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
  align-self:center;flex-shrink:0;flex-grow:0;width:auto;white-space:nowrap;text-decoration:none;
}
.theme-toggle:hover {
  border-color:var(--brand);
  transform:translateY(-1px);
  box-shadow:0 6px 20px -2px rgba(0, 210, 255, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.22);
  color:var(--text) !important;
}
.theme-toggle svg {
  color:var(--brand);
  flex-shrink:0;
  filter:drop-shadow(0 0 6px rgba(0, 210, 255, 0.40));
}

.tag-login, a.tag-login, .nav-cta-signin {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--panel-2);
  border:1px solid rgba(168, 85, 247, 0.35);
  color:var(--text) !important;padding:0 16px;height:36px;box-sizing:border-box;border-radius:999px;font-size:13px;font-weight:700;cursor:pointer;
  font-family:inherit;transition:all 0.25s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  box-shadow:0 4px 15px -2px rgba(168, 85, 247, 0.12), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  align-self:center;flex-shrink:0;flex-grow:0;width:auto;white-space:nowrap;text-decoration:none;
}
.tag-login:hover, a.tag-login:hover, .nav-cta-signin:hover {
  background:linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-color:transparent;
  transform:translateY(-2px);
  box-shadow:0 8px 22px -2px rgba(168, 85, 247, 0.45);
  color:#ffffff !important;
}
.tag-login svg, a.tag-login svg, .nav-cta-signin svg {
  color:#a855f7;
  flex-shrink:0;
  filter:drop-shadow(0 0 6px rgba(168, 85, 247, 0.40));
  transition:transform 0.25s ease, color 0.25s ease;
}
.tag-login:hover svg, a.tag-login:hover svg, .nav-cta-signin:hover svg {
  color:#ffffff;
  transform:scale(1.15);
}

.shell{width:100%;max-width:420px;position:relative;z-index:1}
.top-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.logo{font-weight:800;font-size:22px;letter-spacing:-0.4px;color:var(--text)}
.logo small{display:block;font-weight:500;color:var(--muted);font-size:11.5px;letter-spacing:0;margin-top:1px}
.card{
  background:var(--panel);border:1px solid var(--line);
  border-radius:22px;padding:32px;box-shadow:var(--shadow);margin-top:12px;
  backdrop-filter:blur(20px);position:relative;overflow:hidden;
}
.card::before{
  content:"";position:absolute;top:0;left:0;right:0;height:3px;
  background:linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}
h1{font-size:22px;font-weight:800;letter-spacing:-0.3px;margin:0 0 6px}
.sub{color:var(--muted);font-size:14px;margin:0 0 24px;line-height:1.55}
label{display:block;font-size:13px;color:var(--muted);margin:0 0 7px;font-weight:600}
input{
  width:100%;background:var(--panel-2);border:1px solid var(--line);color:var(--text);
  border-radius:12px;padding:12px 14px;font-size:14.5px;font-family:inherit;margin-bottom:16px;
  transition:all 0.25s cubic-bezier(0.16, 1, 0.3, 1);backdrop-filter:blur(8px);
}
input:focus{
  outline:none;border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(0, 242, 254, 0.18), 0 4px 20px rgba(0, 242, 254, 0.12);
  transform:translateY(-1px);
}
/* Filled at rest so the submit action is unmistakable (matches the app's
   primary buttons). This purple stays ≥5:1 against white text at both ends.
   Scoped to .btn-signin, NOT the bare `button` element: the theme toggle and
   the language dropdown are buttons too, and the white `color` below was
   overriding the dropdown's own text colour on hover. */
.btn-signin {
  width:100%;border:1px solid rgba(255, 255, 255, 0.18);border-radius:999px;padding:13px 24px;font-size:14.5px;font-weight:700;
  cursor:pointer;font-family:inherit;background:linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);color:#ffffff;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  box-shadow:0 4px 15px -2px rgba(168, 85, 247, 0.30), inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
  transition:all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.btn-signin:hover {
  filter:brightness(1.12);
  border-color:rgba(255, 255, 255, 0.3);
  color:#ffffff;
  transform:translateY(-2px);
  box-shadow:0 10px 28px -4px rgba(168, 85, 247, 0.50);
}
.btn-signin:hover svg {
  color:#ffffff;
  transform:scale(1.15);
}
.btn-signin:active {
  transform:translateY(1px) scale(0.98);
}
.row{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin:-4px 0 18px}
.demo{
  background:var(--chip);border:1px solid var(--line);border-radius:12px;padding:12px 14px;
  font-size:12.5px;color:var(--muted);margin-top:20px;line-height:1.5;
}
.foot{text-align:center;color:var(--muted-2);font-size:13px;margin-top:20px;font-weight:500}

/* ==========================================================================
   LANGUAGE SELECTOR COMPONENT (NON-FUNCTIONAL UI)
   ========================================================================== */
.lang-selector-wrap {
  position: relative;
  display: inline-block;
  align-self: center;
  flex-shrink: 0;
  z-index: 100;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text) !important;
  padding: 0 12px;
  height: 34px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px -2px rgba(0, 210, 255, 0.12), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.lang-toggle:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(0, 210, 255, 0.28), inset 0 1px 0 0 rgba(255, 255, 255, 0.20);
}
.lang-toggle .lang-flag {
  font-size: 14px;
  line-height: 1;
}
.lang-toggle .lang-code {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.lang-toggle .lang-chevron {
  color: var(--muted);
  transition: transform 0.25s ease;
  margin-left: 2px;
}
.lang-selector-wrap.open .lang-toggle .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  max-height: 360px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 1000;
}
.lang-selector-wrap.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-dropdown-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
}
.lang-dropdown-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.lang-dropdown-header .lang-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ai-bg);
  border: 1px solid var(--line);
  color: var(--brand);
  font-weight: 700;
}

.lang-dropdown-list {
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
}
.lang-dropdown-list::-webkit-scrollbar {
  width: 5px;
}
.lang-dropdown-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  color: var(--text);
  border: none;
  background: transparent;
  box-shadow: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.lang-option:hover {
  background: var(--panel-2);
  color: var(--text);
}
.lang-option.active {
  background: var(--active-psp-bg);
  color: var(--brand);
  font-weight: 700;
}
.lang-option-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-option-flag {
  font-size: 16px;
  line-height: 1;
}
.lang-option-name {
  font-size: 13px;
  font-weight: 600;
}
.lang-option-native {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}
.lang-option-check {
  font-size: 12px;
  color: var(--brand);
  display: none;
}
.lang-option.active .lang-option-check {
  display: block;
}

.lang-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .lang-dropdown-menu {
    width: 220px;
    right: -10px;
  }
}

/* ==========================================================================
   KEYBOARD FOCUS INDICATORS (mirrors style.css)
   :focus-visible means pointer users never see a ring, only keyboard users do.
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.55);
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] textarea:focus-visible,
html[data-theme="light"] [tabindex]:focus-visible {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
}

