:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --panel: #ffffff;
  --ink: #17212e;
  --muted: #667085;
  --line: #d9e0d8;
  --field: #f9faf8;
  --green: #0f6f58;
  --green-dark: #0a5644;
  --blue: #245b9f;
  --amber: #c77a26;
  --red: #b42318;
  --shadow: 0 22px 55px rgba(29, 39, 48, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(127, 145, 127, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 145, 127, 0.13) 1px, transparent 1px);
  background-size: 38px 38px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.gateway-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 28px;
  padding: 34px 0;
}

.identity-panel {
  padding: 34px 0;
  min-width: 0;
}

.system-label,
.section-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 640px;
  margin-top: 16px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.2;
}

.signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 34px;
}

.signal {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(23, 33, 46, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.signal span,
.status-grid dt {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.signal strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.auth-surface {
  min-height: 570px;
  padding: 28px;
  border: 1px solid rgba(23, 33, 46, 0.1);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.view {
  min-height: 512px;
  display: flex;
  flex-direction: column;
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.ip-badge {
  max-width: 170px;
  padding: 7px 10px;
  border: 1px solid #c9dbd3;
  border-radius: 999px;
  color: var(--green-dark);
  background: #edf6f1;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span:first-child {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--field);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
  border-color: var(--green);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 111, 88, 0.13);
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 52px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #263546;
  background: #ffffff;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button:hover {
  border-color: #b8c6bc;
  background: #f7f8f6;
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#togglePassword {
  position: absolute;
  right: 3px;
  top: 3px;
}

.captcha-block {
  display: grid;
  grid-template-columns: 1fr 218px;
  gap: 12px;
  align-items: end;
}

.captcha-visual {
  height: 48px;
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.captcha-visual img {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f6f7f4;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(15, 111, 88, 0.2);
}

.primary-button:hover {
  background: var(--green-dark);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status-view {
  justify-content: space-between;
}

.status-dot {
  width: 14px;
  height: 14px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(15, 111, 88, 0.14);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 0;
}

.status-grid div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.status-grid dd {
  margin: 10px 0 0;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

#remainingTime {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.site-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.site-strip span {
  padding: 8px 10px;
  border: 1px solid #d7e2ec;
  border-radius: 8px;
  color: #174169;
  background: #f1f6fb;
  font-size: 13px;
  font-weight: 800;
}

.secondary-button {
  width: 100%;
  color: #ffffff;
  background: #27364a;
}

.admin-link {
  min-height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid #c9dbd3;
  border-radius: 8px;
  color: var(--green-dark);
  background: #edf6f1;
  font-weight: 850;
  text-decoration: none;
}

.admin-link:hover {
  background: #e2f0e9;
}

.secondary-button:hover {
  background: #182435;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .gateway-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 22px 0;
  }

  .identity-panel {
    padding: 10px 0 0;
  }

  h1 {
    font-size: 42px;
  }

  .auth-surface {
    min-height: auto;
  }

  .view {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .gateway-shell {
    width: min(100% - 20px, 440px);
    gap: 18px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.14;
  }

  h2 {
    font-size: 24px;
  }

  .signal-list,
  .status-grid,
  .captcha-block {
    grid-template-columns: 1fr;
  }

  .signal-list {
    gap: 8px;
  }

  .signal {
    min-height: auto;
  }

  .auth-surface {
    padding: 20px;
  }

  .surface-head {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .ip-badge {
    max-width: none;
    text-align: left;
  }

  .captcha-visual {
    grid-template-columns: 1fr 42px;
  }
}
