* {
  box-sizing: border-box;
}

html,
body.entry-landing-page {
  min-height: 100%;
}

body.entry-landing-page {
  margin: 0;
  color: #123e88;
  background-color: #c8edff;
  background-image: url("../assets/quest-board/bg-village.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

.intro-overlay {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vh, 64px) 24px;
  background: rgba(231, 248, 255, 0.08);
}

.intro-card {
  width: min(100%, 980px);
  text-align: center;
}

.entry-heading {
  margin: 0 auto;
  padding: 24px 18px 14px;
}

.entry-heading h1 {
  margin: 0;
  color: #0d47a1;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 1.08;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.82), 0 8px 22px rgba(43, 111, 172, 0.18);
}

.entry-heading h1 span {
  display: block;
}

.entry-heading p {
  margin: 22px 0 0;
  color: #31445d;
  font-size: clamp(1rem, 1.9vw, 1.35rem);
  font-weight: 800;
  line-height: 1.5;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.92);
}

.role-cards {
  width: min(100%, 590px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: clamp(32px, 6vh, 62px) auto 0;
}

.role-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 30px 22px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.96);
  color: #124ba0;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(50, 78, 72, 0.24);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.role-card:hover {
  transform: translateY(-5px);
  border-color: #f2c94c;
  box-shadow: 0 24px 50px rgba(34, 79, 122, 0.28);
}

.role-card:focus-visible {
  outline: 4px solid rgba(14, 91, 206, 0.28);
  outline-offset: 4px;
}

.role-icon {
  min-height: 76px;
  display: grid;
  place-items: center;
  color: #1759bb;
  font-size: 4rem;
}

.role-card strong {
  color: #124ba0;
  font-size: 1.42rem;
  font-weight: 950;
}

.role-description {
  min-height: 42px;
  color: #526477;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
}

.role-card-arrow {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  border-radius: 50%;
  background: #165dcc;
  color: #fff;
  font-size: 1.15rem;
}

.theme-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 35, 63, 0.72);
}

.theme-modal {
  width: min(100%, 470px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 34px;
  border: 3px solid #f0ca58;
  border-radius: 32px;
  background: #fffdf8;
  color: #213a56;
  text-align: center;
  box-shadow: 0 28px 72px rgba(10, 35, 63, 0.35);
}

.login-modal-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: #e9f3ff;
  color: #165dcc;
  font-size: 2.25rem;
}

.theme-modal h2 {
  margin: 0 0 10px;
  color: #10479a;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  letter-spacing: -0.04em;
}

.theme-modal p {
  margin: 0;
  color: #5c6f82;
  line-height: 1.6;
}

#teacherLoginMsg:not(:empty) {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #eef6ff;
  color: #174f91;
  font-weight: 750;
}

.login-stack {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.login-stack input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #a8c8e7;
  border-radius: 13px;
  background: #fff;
  color: #17324d;
}

.login-stack input:focus-visible {
  border-color: #165dcc;
  outline: 3px solid rgba(22, 93, 204, 0.18);
}

.login-button {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid #165dcc;
  border-radius: 13px;
  background: #165dcc;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.login-button:hover {
  background: #0f4eaf;
}

.login-button:focus-visible,
.back-button:focus-visible {
  outline: 3px solid rgba(22, 93, 204, 0.25);
  outline-offset: 3px;
}

.login-button.google {
  margin-top: 22px;
  border-color: #a8c8e7;
  background: #fff;
  color: #174f91;
}

.login-button.google:hover,
.login-button.secondary:hover {
  background: #eef6ff;
}

.login-button.secondary {
  border-color: #9cbfe1;
  background: #f7fbff;
  color: #174f91;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  color: #73859a;
  font-size: 0.82rem;
  font-weight: 750;
}

.divider::before,
.divider::after {
  height: 1px;
  flex: 1;
  background: #d7e2ec;
  content: "";
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #315a88;
  font-weight: 850;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .intro-overlay {
    align-items: start;
    padding: 28px 16px 34px;
  }

  .entry-heading {
    padding-top: 8px;
  }

  .entry-heading h1 {
    font-size: clamp(2.25rem, 12vw, 3.6rem);
  }

  .entry-heading p {
    margin-top: 14px;
    font-size: 0.98rem;
  }

  .role-cards {
    width: min(100%, 430px);
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
  }

  .role-card {
    min-height: 154px;
    display: grid;
    grid-template-columns: 62px 1fr 44px;
    grid-template-rows: auto auto;
    gap: 4px 14px;
    padding: 20px;
    text-align: left;
  }

  .role-icon {
    min-height: 0;
    grid-row: 1 / span 2;
    font-size: 2.8rem;
  }

  .role-card strong {
    align-self: end;
    font-size: 1.2rem;
  }

  .role-description {
    min-height: 0;
    align-self: start;
    font-size: 0.88rem;
  }

  .role-card-arrow {
    width: 42px;
    height: 42px;
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
  }

  .theme-modal {
    padding: 26px 20px;
    border-radius: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .role-card {
    transition: none;
  }
}
