/* eBusinessGate — login / gate page
   Restyled to match the marketing site's dark glass theme (same tokens as
   the eBusinessGate landing pages: violet primary, Inter font, glass cards
   on a dark radial-glow background). Class names/structure in login.html
   are unchanged — this is a visual-only rewrite. */

:root {
  --accent: #7d70fd;
  --accent-glow: #9f9dff;
  --text: #0c0e1c;
  --text-muted: #60636f;
  --bg: #f9fafe;
  --surface: #ffffff;
  --border: #0c0e1c14;
  --radius: .95rem;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 28px -10px rgba(125,112,253,.18);
  --shadow-lg: 0 24px 70px -20px rgba(125,112,253,.3);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="dark"] {
  --accent: #8c85ff;
  --accent-glow: #adadff;
  --text: #f4f4fa;
  --text-muted: #9c9cb1;
  --bg: #080813;
  --surface: #121221;
  --border: #ffffff14;
  --shadow: 0 1px 0 0 rgba(255,255,255,.04) inset, 0 8px 30px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 70px -20px rgba(140,133,255,.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.gate-body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

html[data-theme="dark"] body.gate-body {
  background:
    radial-gradient(ellipse 900px 600px at 50% -10%, rgba(140,133,255,.18), transparent 65%),
    var(--bg);
}
body.gate-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(140,133,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(140,133,255,.06) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .5;
}

.gate-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

/* ---------- Brand ---------- */

.gate-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.gate-brand-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gate-logo-badge {
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gate-logo-badge img {
  width: 180px;
  max-width: 60vw;
  height: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

html:not([data-theme="dark"]) .gate-logo-badge img {
  filter: none;
}

.gate-brand-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: .2px;
  color: var(--text);
}

.gate-brand-tagline {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.gate-brand-tagline label { font: inherit; color: inherit; }

/* ---------- Form panel / card ---------- */

.gate-form-panel {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Orbit decoration ----------
   Back to the original concentric-ring version wrapping the card (reverted
   2026-10-13 -- tried a side-gap "comet trail" redesign per sketch, but the
   user preferred this first version after seeing it). */

.gate-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 170vw);
  height: min(760px, 170vw);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}

html:not([data-theme="dark"]) .gate-orbit { opacity: .6; }

.gate-orbit-spin-slow { transform-origin: 320px 320px; animation: gate-orbit-rotate 90s linear infinite; }
.gate-orbit-spin { transform-origin: 320px 320px; animation: gate-orbit-rotate 50s linear infinite; }
.gate-orbit-spin-rev { transform-origin: 320px 320px; animation: gate-orbit-rotate-rev 70s linear infinite; }

@keyframes gate-orbit-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes gate-orbit-rotate-rev { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

@media (prefers-reduced-motion: reduce) {
  .gate-orbit-spin-slow, .gate-orbit-spin, .gate-orbit-spin-rev { animation: none; }
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,.03);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 40px 36px 32px;
}

html:not([data-theme="dark"]) .gate-card {
  background: var(--surface);
}

.gate-card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  font-family: "Inter Tight", var(--font);
}

.gate-card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 26px;
}

.gate-field {
  position: relative;
  margin-bottom: 16px;
}

.gate-field i.fa {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.gate-field input[type="text"],
.gate-field input[type="password"] {
  width: 100%;
  padding: 12px 14px 12px 38px;
  font-size: 14.5px;
  font-family: var(--font);
  color: var(--text);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: .95rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

html:not([data-theme="dark"]) .gate-field input[type="text"],
html:not([data-theme="dark"]) .gate-field input[type="password"] {
  background: var(--bg);
}

/* Chrome/Edge paint autofilled fields with their own yellow/grey highlight
   via an internal -webkit-autofill state that a plain `background` rule
   can't override (confirmed live 2026-10-13 -- a saved business
   account/username/password autofilling on return visits showed as flat
   grey boxes regardless of theme). The huge inset box-shadow is the
   standard trick: it paints over the browser's highlight with the real
   field background before the border, in both themes. */
.gate-field input:-webkit-autofill,
.gate-field input:-webkit-autofill:hover,
.gate-field input:-webkit-autofill:focus,
.gate-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--bg) inset;
  box-shadow: 0 0 0px 1000px var(--bg) inset;
  transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}

.gate-field input[type="text"]:focus,
.gate-field input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140,133,255,.25);
}

.gate-field input::placeholder { color: var(--text-muted); opacity: .8; }

.gate-forgot {
  text-align: right;
  margin: -4px 0 20px;
}

.gate-forgot a,
.gate-forgot span {
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}

.gate-forgot a:hover,
.gate-forgot span:hover {
  color: var(--accent);
}

.gate-submit {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  color: #fbfbff;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(140,133,255,.25), 0 12px 30px -10px rgba(140,133,255,.5);
  transition: filter .15s ease, transform .05s ease;
}

.gate-submit:hover { filter: brightness(1.1); }
.gate-submit:active { transform: translateY(1px); }

.gate-register {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.gate-register input[type="submit"] {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.gate-register input[type="submit"]:hover { text-decoration: underline; }

.gate-tutorial-link {
  margin-top: 14px;
  text-align: center;
}

.gate-tutorial-link a,
.gate-tutorial-link input[type="button"] {
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}

.gate-tutorial-link a:hover,
.gate-tutorial-link input[type="button"]:hover { color: var(--accent); }

#index_login_results {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  color: #ff6266;
  text-align: center;
}

/* ---------- Language switcher ---------- */

.gate-topbar {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gate-lang {
  position: relative;
  text-align: left;
}

.gate-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255,255,255,.03);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.gate-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.gate-theme-icon { width: 16px; height: 16px; }
.gate-theme-icon-moon { display: none; }
html[data-theme="dark"] .gate-theme-icon-sun { display: none; }
html[data-theme="dark"] .gate-theme-icon-moon { display: block; }

.gate-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: rgba(255,255,255,.03);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
}

.gate-lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.gate-lang-toggle img { width: 14px; height: 14px; opacity: .85; }
.gate-lang-globe { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.gate-lang-toggle:hover .gate-lang-globe { color: var(--accent); }
.gate-lang-chevron { opacity: .55; }

/* Modern searchable language panel -- replaces the old plain "EN | English"
   text toggle + raw unstyled <select>. Rows keep the real "CODE | Name"
   anchors index.js already builds (so upd_lang_code()'s " | " split and the
   whole translation pipeline keep working unchanged) -- only the chrome
   around them is new. */
.gate-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
}

#myInput {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
#myInput:focus { border-color: var(--accent); }

.gate-lang-list {
  max-height: 260px;
  overflow-y: auto;
}

.gate-lang-list a {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: var(--font);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.gate-lang-list a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

/* ---------- Footer ---------- */

.gate-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.gate-footer a { color: var(--text-muted); text-decoration: none; }
.gate-footer a:hover { color: var(--accent); }

/* ---------- Tutorial modal ---------- */

#display_tutorial_message {
  border-radius: 16px !important;
  border: none !important;
  background: rgba(8,8,19,.6) !important;
  padding: 0 !important;
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 50;
}

#display_tutorial_message > div {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 90vw);
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#display_tutorial_messageheader td {
  font-family: var(--font) !important;
  color: var(--text) !important;
  background: rgba(255,255,255,.03);
  padding: 12px 16px;
}

#display_tutorial_messageheader input[type="button"] {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

/* ---------- Floating theme toggle (unrelated widget kept as-is) ---------- */

.ebg-theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 18px;
  font-family: var(--font);
}

.ebg-theme-toggle:hover { border-color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .gate-shell { padding: 24px 16px; }
  .gate-logo-badge img { width: 140px; }
  .gate-brand-title { font-size: 21px; }
  .gate-card { padding: 32px 24px 26px; }
  .gate-topbar { top: 14px; right: 16px; }
}
