/* PlusX Station authentication — sso-client-example-master/account/templates/oauth2_client/login.html 디자인 그대로 이식.
   단, logo.svg 는 예제(Contact 사) 전용 워드마크라 우리 자체 마크(plusx-stroke.svg)로 대체. */

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

.auth {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: #F5F5F5;  /* 로그인 배경 — 로딩(oauth_callback)은 .oauth-loading 이 흰색으로 별도 오버라이드 */
}

.auth__card {
  position: relative;
  width: clamp(320px, 90vw, 488px);
  height: clamp(500px, 60vh, 520px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 20px);
  padding: 32px;
  background: #FFFFFF;
  border: 1px solid #DADADA;
  border-radius: 8px;
}

/* 상단: 로고 마크 + 워드마크 (예제의 top-section — 로고 이미지 자리) */
.auth__top {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth__logo {
  display: block;
  width: 58.14px;
  height: 28.52px;  /* 41.53×20.37 의 1.4배. Figma export SVG가 preserveAspectRatio="none"이라 auto 비율 계산이 깨짐 — 양쪽 다 명시 */
}
.auth__wordmark {
  margin: 0;
  color: #000000;
  font-family: 'Strichpunkt Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.8px;
  white-space: nowrap;
}

/* OAuth 에러 메시지 — 평소엔 숨김, JS 가 텍스트를 채우고 --error 를 부여하면 우하단 토스트로 노출 */
.auth__sub {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 280px;
  padding: 12px 20px;
  background: #F44336;
  color: #FFFFFF;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -.01em;
}
.auth__sub--error { display: flex; }

/* 하단: 그룹웨어 로그인 버튼 (예제의 bottom-section — 좌우로 8px 더 넓게 뺀 negative margin 포함) */
.auth__bottom { margin: 0 -8px 12px -8px; }
.auth__button {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: #000000;
  cursor: pointer;
  transition: filter .3s ease, transform var(--card-press-dur) ease;
}
.auth__button:hover { filter: brightness(1.25); }
.auth__button:active { transform: scale(var(--card-press-scale)); }
.auth__button:focus-visible { outline: 2px solid #000000; outline-offset: 3px; }
.auth__button-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
}
.auth__button-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.auth__button-label {
  color: #FFFFFF;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}

/* 로딩(콜백) 화면 — sso-client-example-master/account/templates/oauth2_client/callback.html 디자인 그대로 이식 (흰 배경, 걷는 아이콘 + 점선 도로) */
.oauth-loading {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}
.oauth-loading__icon {
  position: relative;
  width: 60px;
  height: 60px;
  z-index: 2;
}
.oauth-loading__ground {
  position: absolute;
  bottom: 51%;
  width: 90px;
  height: 4px;
  z-index: 3;
  background: repeating-linear-gradient(to right, #000 0, #000 20px, transparent 20px, transparent 40px);
  animation: oauthGroundMove 1.1s linear infinite;
}
.oauth-loading__text-wrap {
  display: flex;
  align-items: center;
}
.oauth-loading__text {
  margin-top: 30px;
  font-size: 1.2rem;
  color: #000000;
}

@keyframes oauthGroundMove {
  0% { background-position-x: 90px; }
  100% { background-position-x: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .oauth-loading__ground { animation: none; }
}
