/* Shared portal login shell — Owner/Member (index) + Admin */
.xdt-login {
  --xdt-login-blue: #2563eb;
  --xdt-login-blue-strong: #1d4ed8;
  --xdt-login-ink: #0f172a;
  --xdt-login-muted: #64748b;
  --xdt-login-line: #e2e8f0;
  --xdt-login-card: #ffffff;
  --xdt-login-bg: #f4f7fb;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--xdt-login-bg);
  color: var(--xdt-login-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}
.xdt-login__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.xdt-login__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000 30%, transparent 85%);
}
.xdt-login__energy {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 8%;
  height: 42%;
  background:
    radial-gradient(ellipse 40% 50% at 20% 60%, rgba(59, 130, 246, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 60% at 70% 40%, rgba(96, 165, 250, 0.12), transparent 72%);
}
.xdt-login__energy::before,
.xdt-login__energy::after {
  content: '';
  position: absolute;
  left: -5%;
  right: -5%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.55), transparent);
  filter: blur(0.2px);
}
.xdt-login__energy::before { top: 38%; transform: rotate(-4deg); opacity: 0.7; }
.xdt-login__energy::after { top: 58%; transform: rotate(3deg); opacity: 0.45; }
.xdt-login__skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background:
    linear-gradient(to top, rgba(226, 232, 240, 0.55), transparent),
    repeating-linear-gradient(
      90deg,
      transparent 0 28px,
      rgba(148, 163, 184, 0.18) 28px 30px,
      transparent 30px 54px,
      rgba(148, 163, 184, 0.12) 54px 58px
    );
  mask-image: linear-gradient(to top, #000 20%, transparent 95%);
  opacity: 0.55;
}

.xdt-login__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.9fr);
  grid-template-rows: 1fr auto 1fr;
  align-items: end;
  column-gap: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 48px 40px;
  box-sizing: border-box;
}

.xdt-login__hero {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
}
.xdt-login__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--xdt-login-ink);
  letter-spacing: 0.01em;
}
.xdt-login__bolt {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}
.xdt-login__bolt svg { width: 16px; height: 16px; display: block; }
.xdt-login__hero h1 {
  margin: 48px 0 12px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.25;
  font-weight: 760;
  color: var(--xdt-login-ink);
  max-width: 16em;
}
.xdt-login__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--xdt-login-muted);
  max-width: 22em;
}
.xdt-login__art {
  margin-top: 36px;
  max-width: 640px;
  width: 100%;
}
.xdt-login__art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(38vh, 340px);
  object-fit: contain;
  object-position: left bottom;
  user-select: none;
  pointer-events: none;
}

.xdt-login__panel {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  padding: 12px 8px;
}
.xdt-login__mobile-brand { display: none; }
.xdt-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--xdt-login-card);
  border: 1px solid #e8eef5;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  padding: 36px 34px 28px;
  box-sizing: border-box;
}
.xdt-login__card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 750;
  color: var(--xdt-login-ink);
  letter-spacing: 0.01em;
}
.xdt-login__card > .xdt-login__sub {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--xdt-login-muted);
  line-height: 1.5;
}
.xdt-login__field { margin-bottom: 18px; }
.xdt-login__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.xdt-login__control {
  position: relative;
  display: flex;
  align-items: center;
}
.xdt-login__control .xdt-login__ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
  display: inline-flex;
}
.xdt-login__control .xdt-login__ico svg { width: 18px; height: 18px; }
.xdt-login__control input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--xdt-login-line);
  border-radius: 12px;
  padding: 0 44px 0 44px;
  font-size: 15px;
  color: var(--xdt-login-ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.xdt-login__control input::placeholder { color: #94a3b8; }
.xdt-login__control input:focus {
  border-color: var(--xdt-login-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.xdt-login__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.xdt-login__toggle:hover { color: var(--xdt-login-blue); background: #f8fafc; }
.xdt-login__toggle svg { width: 18px; height: 18px; }

.xdt-login__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
  font-size: 13px;
  color: #475569;
}
.xdt-login__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.xdt-login__remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--xdt-login-blue);
}

.xdt-login__error {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
}

.xdt-login__submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--xdt-login-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}
.xdt-login__submit:hover:not(:disabled) {
  background: var(--xdt-login-blue-strong);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}
.xdt-login__submit:active:not(:disabled) { transform: translateY(1px); }
.xdt-login__submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  box-shadow: none;
}

.xdt-login__secure {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .xdt-login__layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
    padding: 20px 16px 28px;
    min-height: 100dvh;
  }
  .xdt-login__hero { display: none; }
  .xdt-login__mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 17px;
    font-weight: 700;
    color: var(--xdt-login-ink);
  }
  .xdt-login__mobile-brand .xdt-login__bolt {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }
  .xdt-login__mobile-brand .xdt-login__bolt svg { width: 14px; height: 14px; }
  .xdt-login__panel {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    padding: 0;
    align-items: stretch;
    flex-direction: column;
  }
  .xdt-login__card {
    max-width: none;
    width: 100%;
    padding: 28px 20px 22px;
    border-radius: 16px;
  }
  .xdt-login__card h2 { font-size: 24px; }
  .xdt-login__skyline { height: 72px; opacity: 0.35; }
  .xdt-login__energy { bottom: 0; height: 28%; }
}

@media (min-width: 769px) and (max-height: 760px) {
  .xdt-login__hero h1 { margin-top: 28px; font-size: 30px; }
  .xdt-login__art img { max-height: 220px; }
  .xdt-login__card { padding: 28px 28px 22px; }
}
