@font-face {
  font-family: "Pretendard";
  src: url("./fonts/PretendardVariable.woff2") format("woff2");
  font-display: swap;
}

:root {
  --portal-bg: #f3f5f3;
  --portal-surface: #fbfcfb;
  --portal-ink: #18221f;
  --portal-muted: #65726d;
  --portal-line: #d8dedb;
  --portal-mint: #1b855e;
  --portal-blue: #557b91;
  --portal-radius: 6px;
  font-family: "Pretendard", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--portal-ink);
  background: var(--portal-bg);
}

* { box-sizing: border-box; }

body {
  min-width: 0;
  margin: 0;
  background: var(--portal-bg);
}

.portal-shell {
  width: min(100% - 64px, 1050px);
  margin: 0 auto;
  padding: 32px 0 72px;
}

.portal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--portal-line);
}

.portal-brand { font-size: 0.9375rem; letter-spacing: -0.02em; }

.portal-tag {
  padding: 5px 9px;
  border: 1px solid #b9d6c8;
  border-radius: 3px;
  color: #146747;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.portal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: clamp(32px, 8vw, 112px);
  align-items: end;
  padding: clamp(68px, 12vw, 132px) 0 48px;
}

.portal-intro--lobby {
  display: block;
}

.portal-intro--lobby h1 {
  max-width: none;
  font-size: clamp(1.125rem, 2.8vw, 2.25rem);
  white-space: nowrap;
  overflow-wrap: normal;
}

.portal-kicker {
  margin: 0 0 14px;
  color: var(--portal-mint);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(2.25rem, 4.7vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.portal-description {
  margin: 0 0 5px;
  color: var(--portal-muted);
  font-size: 0.975rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.login-form { display: grid; gap: 16px; width: min(100%, 360px); padding: 24px; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); background: var(--portal-surface); }
.field { display: grid; gap: 7px; font-size: 0.875rem; font-weight: 700; }
.field input, .login-form button { min-height: 44px; width: 100%; border-radius: 4px; font: inherit; }
.field input { border: 1px solid #aebbb5; padding: 0 12px; background: #fff; color: var(--portal-ink); }
.login-form button { border: 1px solid var(--portal-mint); background: var(--portal-mint); color: #fff; font-weight: 700; cursor: pointer; }
.login-error { margin: 0; color: #a32d2d; font-size: 0.875rem; }
.portal-intro--login { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
.client-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 27px;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  color: inherit;
  appearance: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--portal-mint);
  content: "";
}

.client-card--dongseoul::before { background: var(--portal-blue); }
.client-card:hover { background: #eef1ef; border-color: #aebbb5; box-shadow: 0 7px 18px rgb(24 34 31 / 8%); transform: translateY(-2px); }
.client-card:focus-visible { outline: 3px solid #75b99d; outline-offset: 3px; }
.client-card[aria-disabled="true"] { cursor: not-allowed; opacity: 0.62; }
.client-card[aria-disabled="true"]:hover { border-color: var(--portal-line); box-shadow: none; transform: none; }

.client-number {
  color: var(--portal-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.client-content { display: grid; gap: 10px; }
.client-kind { color: var(--portal-mint); font-size: 0.8125rem; font-weight: 700; }
.client-card--dongseoul .client-kind { color: #456d84; }
.client-name { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.22; overflow-wrap: anywhere; }
.client-copy { color: var(--portal-muted); font-size: 0.9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.client-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--portal-line); color: var(--portal-ink); font-size: 0.9375rem; font-weight: 700; }
.client-loading { display: inline-flex; align-items: center; gap: 9px; }
.client-spinner { width: 15px; height: 15px; box-sizing: border-box; border: 2px solid #b4c2bb; border-top-color: var(--portal-mint); border-radius: 50%; animation: client-entry-spin 700ms linear infinite; }
@keyframes client-entry-spin { to { transform: rotate(360deg); } }
.client-arrow { color: var(--portal-mint); font-size: 1.25rem; line-height: 1; }
.client-card--dongseoul .client-arrow { color: var(--portal-blue); }

.portal-transition {
  display: grid;
  min-height: min(560px, calc(100vh - 112px));
  place-items: center;
  padding: 32px 0;
}

.portal-transition__content { display: grid; place-items: center; }
.portal-transition__spinner { display: block; width: 40px; height: 40px; border-width: 4px; }

@media (max-width: 640px) {
  .portal-shell { width: min(100% - 48px, 1050px); padding: 24px 0 48px; }
  .portal-intro, .portal-intro--login { grid-template-columns: 1fr; gap: 20px; padding: 64px 0 36px; }
  h1 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .client-grid { grid-template-columns: 1fr; gap: 14px; }
  .client-card { min-height: 230px; padding: 24px; }
  .portal-transition { min-height: calc(100vh - 96px); padding: 24px 0; }
}

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