/* ==========================================================================
   Mahod GIS — login page. Colour tokens come from theme.css.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  background: radial-gradient(1200px 760px at 30% 45%, var(--hero-a) 0%, var(--hero-b) 70%) fixed, var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

[data-theme="light"] .only-dark,
[data-theme="dark"] .only-light { display: none !important; }

/* ---------- Background ---------- */

.login-topo {
  position: fixed;
  left: -40px;
  top: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  z-index: 0;
  animation: drift 40s ease-in-out infinite alternate;
}

.login-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(270deg, rgba(var(--bg-rgb), .9) 0%, rgba(var(--bg-rgb), .55) 45%, rgba(var(--bg-rgb), .2) 100%);
}

/* ---------- Layout ---------- */

.login-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: clamp(28px, 6vh, 72px) clamp(20px, 6vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 440px);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.login-brand { display: flex; flex-direction: column; align-items: flex-start; }
.brand-logo { display: block; height: 44px; width: auto; margin-bottom: clamp(28px, 6vh, 56px); }

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
}
.kicker::before { content: ""; width: 44px; height: 2px; background: linear-gradient(270deg, #1a6fb5, #2eaa6f); }

.gis-wrap { position: relative; }
.gis {
  display: block;
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(110px, min(16vw, 26vh), 240px);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.04em;
  background-image: var(--gis);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shine 10s linear infinite;
}
.gis-glow { position: absolute; inset: 0; filter: blur(46px); opacity: var(--glow-o); pointer-events: none; }

.brand-lede { margin: 26px 0 0; max-width: 480px; font-size: 18px; line-height: 1.7; color: var(--ink-2); }

/* ---------- Card ---------- */

.login-card {
  padding: clamp(26px, 4vh, 40px) clamp(24px, 3vw, 36px);
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-bd);
  box-shadow: 0 1px 2px rgba(15, 34, 48, .05), 0 30px 70px -34px rgba(15, 34, 48, .35);
}

.login-card h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.card-sub { margin: 8px 0 26px; font-size: 15px; color: var(--ink-2); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus { outline: none; border-color: var(--a3); box-shadow: 0 0 0 3px rgba(46, 170, 111, .22); }

.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-left: 64px; }
.pass-toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  min-width: 52px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--link);
  font: 600 13px/1 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  cursor: pointer;
}
.pass-toggle:hover { background: var(--seg-bg); }

.submit {
  position: relative;
  height: 54px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 600 17px/1 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .3s ease, transform .3s ease;
}
.submit:hover { background: var(--btn-hbg); color: var(--btn-hink); transform: translateY(-1px); }
.submit:disabled { cursor: progress; opacity: .85; transform: none; }
.spinner {
  display: none;
  position: absolute;
  left: 20px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .8s linear infinite;
}
.submit.is-busy .spinner { display: block; }

:focus-visible { outline: 2px solid var(--a3); outline-offset: 3px; }

.form-msg { min-height: 22px; margin: 0; font-size: 14.5px; line-height: 1.5; }
.form-msg.is-error { color: #c0392b; }
.form-msg.is-warn { color: #b26a00; }
.form-msg.is-ok { color: var(--t3); }
[data-theme="dark"] .form-msg.is-error { color: #ff8a80; }
[data-theme="dark"] .form-msg.is-warn { color: #ffc46b; }

.card-help { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }

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

.login-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px clamp(20px, 6vw, 96px) 18px;
  font-size: 13px;
  color: var(--ink-3);
}
.login-foot .mono { font-size: 11.5px; letter-spacing: .14em; }

/* ---------- Motion ---------- */

@keyframes shine { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-34px, -16px) scale(1.045); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .login-veil { background: linear-gradient(180deg, rgba(var(--bg-rgb), .3) 0%, rgba(var(--bg-rgb), .85) 60%, var(--bg) 100%); }
  .brand-logo { height: 30px; margin-bottom: 28px; }
  .gis { font-size: clamp(96px, 30vw, 150px); }
  .brand-lede { display: none; }
}
