:root {
  --bg: #ece7e1;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --stroke: rgba(32, 31, 29, 0.1);
  --text: #171717;
  --muted: #635f59;
  --accent: #0d6d68;
  --gold: #8f6b2e;
  --danger: #bc3a3a;
  --shadow: 0 20px 50px rgba(30, 26, 20, 0.08);
  --shadow-soft: 0 12px 28px rgba(30, 26, 20, 0.06);
  --radius-xl: 28px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 109, 104, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(143, 107, 46, 0.12), transparent 28%),
    linear-gradient(180deg, #ebe6df 0%, #f7f2eb 52%, #efeae4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 23, 23, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
}

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

.auth-card {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(253, 248, 241, 0.88)),
    radial-gradient(circle at top right, rgba(13, 109, 104, 0.1), transparent 42%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  top: -84px;
  right: -72px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 109, 104, 0.14), transparent 62%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-family: "DM Sans", sans-serif;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-copy,
.auth-hint {
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(23, 23, 23, 0.05);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.auth-chip--accent {
  color: var(--accent);
  background: rgba(13, 109, 104, 0.1);
  border-color: rgba(13, 109, 104, 0.12);
}

.auth-chip--neutral {
  color: var(--gold);
  background: rgba(143, 107, 46, 0.1);
  border-color: rgba(143, 107, 46, 0.12);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.auth-field span {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-field input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: var(--radius-sm);
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.auth-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.auth-message--neutral {
  color: var(--gold);
  background: rgba(143, 107, 46, 0.09);
  border: 1px solid rgba(143, 107, 46, 0.16);
}

.auth-message--danger {
  color: var(--danger);
  background: rgba(188, 58, 58, 0.09);
  border: 1px solid rgba(188, 58, 58, 0.16);
}

.auth-message--ok {
  color: var(--accent);
  background: rgba(13, 109, 104, 0.09);
  border: 1px solid rgba(13, 109, 104, 0.16);
}

.primary-action {
  padding: 16px 18px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  line-height: 1.2;
  color: #f8f6f2;
  background: linear-gradient(135deg, #0d6d68, #14514e);
  box-shadow: 0 18px 30px rgba(13, 109, 104, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(30, 26, 20, 0.12);
}

.primary-action:focus-visible {
  outline: 3px solid rgba(13, 109, 104, 0.24);
  outline-offset: 2px;
}

.primary-action:disabled {
  opacity: 0.6;
  transform: none;
  cursor: wait;
}

.auth-note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(23, 23, 23, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 244, 237, 0.76));
  box-shadow: var(--shadow-soft);
}

.auth-note .auth-hint {
  margin: 0;
}

@media (max-width: 720px) {
  .auth-card {
    padding: 24px;
    border-radius: 22px;
  }

  .auth-gate {
    padding: 16px;
  }

  .auth-form {
    gap: 14px;
    margin-top: 20px;
  }

  .auth-meta {
    gap: 8px;
  }

  .auth-field input,
  .primary-action {
    padding: 15px 16px;
  }

  .auth-copy,
  .auth-hint,
  .auth-message {
    font-size: 0.96rem;
  }
}
