:root {
  --ink: #161412;
  --muted: #5c564e;
  --paper: #ffffff;
  --line: rgba(22, 20, 18, 0.14);
  --blue: #2f7fe0;
  --gold: #c9a46a;
  --font-display: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --font-ui: "Noto Sans TC", "Noto Serif TC", sans-serif;
  --mast-h: clamp(88px, 14vh, 120px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== White header: GVoice | Educircle ===== */
.login-masthead {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2.5vw, 28px);
  align-items: center;
  min-height: var(--mast-h);
  padding: 16px clamp(16px, 3vw, 40px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  animation: mast-in 0.65s ease both;
}

.login-masthead__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 4.6vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.35em;
  flex-wrap: wrap;
}

.login-masthead__product {
  color: var(--ink);
}

.login-masthead__sep {
  color: rgba(22, 20, 18, 0.35);
  font-weight: 500;
}

.login-masthead__org {
  color: var(--ink);
}

.login-masthead__desc {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(0.82rem, 1.3vw, 0.95rem);
  line-height: 1.45;
  color: var(--muted);
  justify-self: start;
}

.login-masthead__logo {
  width: auto;
  height: clamp(36px, 5.5vh, 48px);
  max-width: min(200px, 36vw);
  object-fit: contain;
  object-position: right center;
  background: transparent;
  border-radius: 0;
  display: block;
  box-shadow: none;
}

@keyframes mast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cartoon image region ===== */
.login-art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: end start;
  overflow: hidden;
  background: #f4efe6;
}

.login-art__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 28%;
  z-index: 0;
  animation: art-in 1.05s ease both;
}

.login-art__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 252, 248, 0.2) 0%, transparent 40%),
    linear-gradient(0deg, rgba(22, 20, 18, 0.2) 0%, transparent 40%);
}

@keyframes art-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

.login-panel {
  position: relative;
  z-index: 2;
  width: min(360px, calc(100% - 32px));
  margin: 0 0 clamp(24px, 5vh, 52px) clamp(16px, 4vw, 44px);
  padding: 24px 22px 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 44px rgba(22, 20, 18, 0.16);
  backdrop-filter: blur(12px) saturate(125%);
  animation: panel-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-panel__eyebrow {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-panel__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  letter-spacing: 0.02em;
}

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

.login-field {
  display: grid;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.login-field input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 2px 11px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1rem;
  background: transparent;
  color: var(--ink);
}

.login-field input:focus {
  outline: none;
  border-bottom-color: var(--blue);
}

.login-error {
  margin: 0 0 10px;
  color: #9b1c1c;
  font-size: 0.9rem;
}

.login-sso {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 0;
  background: linear-gradient(135deg, #3aa0ef 0%, #1b4fbf 52%, #c9a46a 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  box-shadow: 0 8px 20px rgba(27, 79, 191, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.login-sso:hover {
  filter: brightness(1.06);
}

.login-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: rgba(20, 28, 48, 0.62);
  text-align: center;
}

.login-or {
  margin: 16px 0 10px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(20, 28, 48, 0.55);
}

.login-submit {
  margin-top: 4px;
  border: 0;
  background: linear-gradient(135deg, #3aa0ef 0%, #1b4fbf 52%, #c9a46a 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(27, 79, 191, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.login-submit:hover {
  filter: brightness(1.06);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 760px) {
  .login-masthead {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title logo"
      "desc desc";
    row-gap: 8px;
  }

  .login-masthead__left { grid-area: title; }
  .login-masthead__desc { grid-area: desc; max-width: none; }
  .login-masthead__logo { grid-area: logo; width: auto; height: 34px; max-width: 140px; }

  .login-masthead__title {
    font-size: clamp(1.55rem, 7vw, 2.2rem);
  }
}

@media (max-width: 560px) {
  .login-art {
    place-items: end center;
  }

  .login-art__img {
    object-position: 78% 25%;
  }

  .login-panel {
    margin: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 32px);
  }
}
