:root {
  color-scheme: light;
  --bg-top: #f3fbf5;
  --bg-bottom: #d9ecdf;
  --panel: rgba(250, 255, 251, 0.92);
  --panel-border: rgba(76, 155, 115, 0.18);
  --panel-border-strong: rgba(76, 155, 115, 0.28);
  --text: #173126;
  --muted: #5b7769;
  --accent: #4c9b73;
  --accent-strong: #2f7c58;
  --pill-bg: rgba(236, 248, 240, 0.96);
  --danger-bg: rgba(254, 226, 226, 0.92);
  --danger-text: #991b1b;
  --ok-bg: rgba(220, 252, 231, 0.92);
  --ok-text: #166534;
  --neutral-bg: rgba(236, 248, 240, 0.96);
  --neutral-text: #3f6252;
  --shadow: 0 28px 70px rgba(31, 61, 44, 0.16);
  --shadow-soft: 0 14px 34px rgba(42, 78, 59, 0.1);
  --focus-ring: 0 0 0 4px rgba(76, 155, 115, 0.14);
  --font-body: 'IBM Plex Sans', 'Noto Sans TC', 'Segoe UI Variable', sans-serif;
  --font-display: 'Azeret Mono', 'Consolas', monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(134, 239, 172, 0.34), transparent 24%),
    radial-gradient(circle at bottom right, rgba(167, 243, 208, 0.28), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.gate-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(100%, 520px);
  position: relative;
  padding: 32px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(252, 255, 253, 0.98), rgba(242, 249, 245, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.gate-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.02;
}

.gate-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}

.gate-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.google-login-panel {
  margin-top: 24px;
  display: grid;
  justify-items: stretch;
  gap: 10px;
}

.google-sign-in-button {
  min-height: 44px;
}

.google-login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-divider {
  margin: 22px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: rgba(76, 155, 115, 0.18);
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block span {
  font-weight: 600;
  line-height: 1.35;
}

.field-block input {
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(76, 155, 115, 0.22);
  background: linear-gradient(180deg, rgba(249, 253, 250, 0.98), rgba(239, 249, 243, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: var(--text);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.field-block input:focus {
  border-color: rgba(76, 155, 115, 0.44);
  background: rgba(252, 255, 253, 0.99);
}

.field-block input::placeholder {
  color: rgba(91, 119, 105, 0.74);
}

#loginButton {
  min-height: 52px;
  border: 1px solid rgba(47, 124, 88, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f7fff8;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(47, 124, 88, 0.22);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

#loginButton:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(47, 124, 88, 0.24);
}

#loginButton:disabled {
  cursor: wait;
  opacity: 0.78;
}

.auth-message {
  margin: 18px 0 0;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.auth-message--neutral {
  border-color: rgba(77, 124, 96, 0.1);
  background: var(--neutral-bg);
  color: var(--neutral-text);
  box-shadow: var(--shadow-soft);
}

.auth-message--ok {
  border-color: rgba(21, 128, 61, 0.14);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.auth-message--danger {
  border-color: rgba(239, 68, 68, 0.18);
  background: var(--danger-bg);
  color: var(--danger-text);
}

@media (max-width: 640px) {
  .gate-shell {
    padding: 14px;
  }

  .gate-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .gate-copy {
    line-height: 1.6;
    font-size: 0.98rem;
  }

  .field-block input {
    min-height: 56px;
  }

  #loginButton {
    min-height: 54px;
  }
}

@media (max-width: 420px) {
  .gate-shell {
    padding: 12px;
  }

  .gate-card {
    padding: 20px 16px;
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.3rem);
  }
}
