* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 38px 24px 0;
  overflow-x: hidden;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "PingFang TC",
    "Microsoft JhengHei",
    sans-serif;
  color: #edf6ff;
  background:
    radial-gradient(circle at 20% 15%, rgba(43, 130, 190, 0.18), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(44, 207, 196, 0.08), transparent 32%),
    #030d1b;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(100, 170, 220, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 170, 220, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.entrance-wrapper {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, #56b9ff, #70dfd4);
  color: #041525;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 12px 35px rgba(77, 184, 255, 0.16);
}

.brand-text {
  text-align: left;
}

.brand-name {
  margin: 0;
  color: #edf6ff;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.brand-subtitle {
  margin-top: 3px;
  color: #718ba4;
  font-size: 13px;
}

.card,
.public-summary {
  position: relative;
  overflow: hidden;
  border: 1px solid #203c56;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 39, 63, 0.97), rgba(7, 23, 40, 0.98));
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.card {
  padding: 42px;
}

.card::before,
.public-summary::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(63, 179, 255, 0.07);
  filter: blur(15px);
  pointer-events: none;
}

.eyebrow,
.public-kicker {
  position: relative;
  margin-bottom: 16px;
  color: #7f9bb7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 4px;
}

h1 {
  position: relative;
  margin: 0 0 14px;
  color: #f1f7ff;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -1.5px;
}

.description {
  position: relative;
  margin: 0 0 32px;
  color: #90a7bd;
  font-size: 15px;
  line-height: 1.8;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #a9bed1;
  font-size: 13px;
  font-weight: 700;
}

.password-wrapper {
  position: relative;
}

#password {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1px solid #2b4863;
  border-radius: 15px;
  outline: none;
  background: #09192a;
  color: #edf6ff;
  font: inherit;
  font-size: 17px;
  letter-spacing: 3px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#password::placeholder {
  color: #526b82;
  letter-spacing: 0;
}

#password:focus {
  border-color: #48aeea;
  background: #0b1d30;
  box-shadow: 0 0 0 4px rgba(72, 174, 234, 0.09);
}

#submitButton {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #58baff, #69ddd3);
  color: #041624;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(73, 184, 234, 0.12);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

#submitButton:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

#submitButton:active {
  transform: translateY(0);
}

#submitButton:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.error {
  min-height: 21px;
  margin-top: 14px;
  color: #ff9292;
  font-size: 13px;
  text-align: center;
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  color: #58728a;
  font-size: 12px;
}

.public-summary {
  margin-top: 18px;
  padding: 28px 30px;
}

.public-summary h2 {
  position: relative;
  margin: 0 0 10px;
  color: #f1f7ff;
  font-size: 21px;
  letter-spacing: -0.5px;
}

.public-summary > p:not(.public-kicker) {
  position: relative;
  margin: 0;
  color: #8da6bc;
  font-size: 13px;
  line-height: 1.8;
}

.public-features {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.public-features span {
  padding: 7px 10px;
  border: 1px solid rgba(104, 191, 241, 0.14);
  border-radius: 999px;
  background: rgba(79, 167, 222, 0.06);
  color: #9fc8e3;
  font-size: 11px;
  font-weight: 700;
}

.public-privacy {
  padding-top: 16px;
  border-top: 1px solid rgba(120, 172, 210, 0.1);
  color: #66839a !important;
  font-size: 11px !important;
}

/* 舊版入口頁尾保留在內容欄內，但降低存在感；完整 Footer 由 entrance.js 插入。 */
.footer {
  margin-top: 20px;
  color: #4f6981;
  font-size: 11px;
  text-align: center;
}

/* 修正全站 Footer 被 body flex 排到入口卡右側的問題。 */
body.entrance-page > .site-footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: center;
  width: min(900px, 100%);
  margin: 30px auto 0;
}

@media (max-width: 600px) {
  body {
    padding: 22px 16px 0;
  }

  .card {
    padding: 30px 22px;
    border-radius: 24px;
  }

  .public-summary {
    padding: 24px 22px;
    border-radius: 24px;
  }

  h1 {
    font-size: 32px;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
  }

  body.entrance-page > .site-footer {
    margin-top: 22px;
  }
}
