/* YuniID(login.yunisuite.com) 인증 화면 공통 스타일 - login/reset-password/consent가 공유.
   CSP(Content-Security-Policy)를 걸기 위해 인라인 <style>에서 분리한 파일. */
* , *::before, *::after { box-sizing: border-box; }
/* 모바일: 페이지 세로 스크롤/바운스(고무줄) 방지. html은 완전 고정하고 body만
   내부 스크롤을 허용해 키보드가 떠도 입력창엔 접근되지만 페이지 자체는 위아래로 움직이지 않음. */
html {
  height: 100%; overflow: hidden; overscroll-behavior: none;
}
body {
  font-family: -apple-system, 'Pretendard', 'Malgun Gothic', sans-serif;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  min-height: 100%; height: 100%; margin: 0; padding: 20px;
  overflow: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch;
}

.hidden { display: none; }
.divider-pipe { margin: 0 4px; color: #cbd5e1; }
.field-error-inline { margin-top: 4px; margin-bottom: 0; font-size: 12px; }
.success-notice-spaced { margin-top: 2px; }

/* ── login-card (portal.smartertools.co.kr / basic-admin 로그인 카드와 동일한 클래스/규칙) ── */
.login-card {
  background: #fff; border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 40px 36px; width: 100%; max-width: 380px; position: relative;
}
.login-logo { text-align: center; margin-top: 28px; margin-bottom: 28px; }
.login-logo-text { font-size: 1.4rem; font-weight: 800; color: #1c2536; }
.login-label { display: block; font-size: .8rem; font-weight: 600; color: #64748b; margin-bottom: 5px; }
.login-input {
  width: 100%; box-sizing: border-box; height: 35px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 0 12px; font-size: .9rem; line-height: 1.5; outline: none;
  transition: border-color .2s; margin-bottom: 16px; background-color: #fff;
}
.login-input:focus { border-color: #667eea; }
.login-btn {
  width: 100%; box-sizing: border-box; height: 35px; background: #1c2536; color: #fff; border: none; border-radius: 8px;
  padding: 0 12px; font-size: .95rem; font-weight: 600; cursor: pointer; transition: background .2s;
}
.login-btn:hover { background: #2d3a4f; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-btn.secondary {
  margin-top: 10px; background: #fff; color: #1c2536; border: 1.5px solid #e2e8f0;
}
.login-btn-icon { vertical-align: -3px; margin-right: 6px; }
.action-notice { color: #dc2626; font-size: .82rem; margin-bottom: 12px; }
.success-notice { color: #15803d; font-size: .85rem; text-align: center; }
.muted { color: #64748b; font-size: .85rem; text-align: center; line-height: 1.6; }

#loginLangBtn {
  position: absolute; top: 12px; left: 14px; display: flex; align-items: center; gap: 5px;
  background: none; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 10px;
  font-size: 12px; color: #64748b; cursor: pointer; line-height: 1;
}
#loginLangBtn:hover { background: #f8fafc; }

.login-signup-prompt { margin: 2px 0 14px; font-size: 12.5px; color: #64748b; text-align: center; }
.login-link-btn {
  background: none; border: none; color: var(--clr-primary, #26205a); cursor: pointer;
  padding: 0; font-size: 12.5px; font-weight: 600;
}

.login-remember-row {
  display: flex; align-items: center; gap: 6px; margin: -8px 0 16px;
  font-size: .8rem; color: #64748b; cursor: pointer; user-select: none;
}
.login-remember-row input { margin: 0; cursor: pointer; }

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
  .login-logo-text { font-size: 1.2rem; }
  .login-input { padding: 0 10px; font-size: 1rem; }
  .login-btn { padding: 0 11px; }
}

/* ── Modal (원본: /var/www/basic styles.css의 .modal-overlay/.modal-box 규칙 그대로 재사용) ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-box {
  position: relative; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 24px 24px 20px; width: 340px; max-width: 95vw;
  transform: translateY(8px); transition: transform .18s;
}
.modal-title { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 18px; padding-right: 32px; }
.modal-field { margin-bottom: 14px; }
.modal-label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; display: block; }
.modal-input, .modal-textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #ddd; border-radius: 7px;
  font-size: 13px; color: #333; outline: none; box-sizing: border-box; font-family: inherit;
}
.modal-textarea { resize: vertical; min-height: 60px; }
.modal-input:focus, .modal-textarea:focus { border-color: #1a73e8; }
.modal-footer { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal-close-btn {
  position: absolute; top: 12px; right: 14px; width: 28px; height: 28px;
  border: none; background: transparent; cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; padding: 0; line-height: 1; transition: background .1s; flex-shrink: 0;
}
.modal-close-btn:hover { background: #f1f5f9; color: #1e293b; }
.modal-close-btn svg { display: block; pointer-events: none; }

/* basic-btn (원본과 동일한 클래스/변수) */
.basic-btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .4rem 1rem;
  border: 1px solid transparent; border-radius: 6px; font-size: .8125rem; font-weight: 500;
  line-height: 1.5; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  text-decoration: none; white-space: nowrap; outline: none; box-sizing: border-box; font-family: inherit;
}
.basic-btn.primary { background: #263e0f; color: #fff; border-color: #263e0f; }
.basic-btn.primary:hover { background: #669c35; border-color: #669c35; }
.basic-btn.cancel { background: #fff; color: #555; border-color: #ddd; }
.basic-btn.cancel:hover { background: #f5f5f5; }
.basic-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── consent.ejs 전용 ── */
.consent-card { background:#fff; padding:32px; border-radius:8px; box-shadow:0 2px 12px rgba(0,0,0,.08); width:320px; }
.consent-card button { width:100%; padding:10px; background:#2563eb; color:#fff; border:none; border-radius:4px; font-size:14px; cursor:pointer; }

/* ── MFA(mfa-verify.ejs/mfa-enroll.ejs) 전용 ── */
.mfa-qr-img { display: block; margin: 0 auto 14px; border: 1px solid #e2e8f0; border-radius: 8px; width: 180px; height: 180px; }
.mfa-secret-code {
  display: block; text-align: center; font-family: ui-monospace, monospace; font-size: .85rem;
  letter-spacing: 1px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 8px; margin: 0 0 16px; word-break: break-all;
}
.mfa-code-input { text-align: center; letter-spacing: 4px; font-size: 1.1rem; }

/* ── 오류 페이지(app.js의 buildErrorHtml, "잘못된 접근입니다") 전용.
   body 전체를 이 클래스로 감싸 다른 페이지의 일반 태그 선택자(h1/a 등)와 안 겹치게 함. ── */
.error-page {
  --err-link: #2b5fd9;
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: #fff; color: #1a1a1a;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}
.error-page .box { width: 100%; max-width: 680px; }
.error-page h1 { margin: 0 0 32px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.error-page .detail {
  margin: 0 0 28px; padding: 16px 18px; border-left: 3px solid #dc2626;
  background: #fafafa; font-family: arial; font-size: 13px; word-break: break-all;
}
.error-page .detail dt { font-weight: 700; color: #1a1a1a; }
.error-page .detail dd { margin: 2px 0 12px; color: #dc2626; }
.error-page .detail dd:last-child { margin-bottom: 0; }
.error-page a { color: var(--err-link); font-size: 14px; }
.error-page a:hover { text-decoration: none; }
.error-page a:focus-visible { outline: 2px solid var(--err-link); outline-offset: 3px; }
@media (max-width: 480px) { .error-page h1 { font-size: 24px; } }

/* ── 직접 접근 안내(views/direct-access.ejs) — 로그인 카드보다 30% 넓게(380 → 494px) ── */
.login-card.da-card { max-width: 494px; padding-bottom: 32px; }
.da-logo { margin-bottom: 22px; }
.da-icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: #fef3c7; color: #b45309; display: flex; align-items: center; justify-content: center; }
.da-title { margin: 0 0 10px; text-align: center; font-size: 1.02rem; font-weight: 700; color: #1c2536; }
.da-text { margin: 0 0 8px; text-align: center; font-size: .85rem; line-height: 1.65; color: #475569; }
.da-text b { color: #1c2536; font-weight: 600; }
.da-sep { height: 1px; background: #eef2f6; margin: 20px 0 16px; }
.da-sub { margin: 0 0 8px; font-size: .78rem; font-weight: 600; color: #64748b; }
.login-btn.da-link { display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.login-btn.da-link.secondary { margin-top: 8px; }
.login-btn.da-link.secondary:hover { background: #f8fafc; }
.da-svc-host { font-weight: 400; color: #94a3b8; font-size: .75rem; margin-left: 4px; }
.da-foot { margin: 18px 0 0; text-align: center; font-size: .75rem; line-height: 1.6; color: #94a3b8; }
.da-foot code { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; color: #64748b; }

/* ── 셀프서비스 «앱 비밀번호»(views/app-passwords.ejs · account-message.ejs, lib/accountPage.js) ── */
/* 화면보다 길어질 수 있어 가운데 맞춤을 margin:auto 로(align-items:center 는 넘친 위쪽이 잘려 스크롤로도 못 본다) */
body.ap-page { align-items: flex-start; }
body.ap-page .login-card.ap-card { margin: auto; }
.login-card.ap-card { max-width: 560px; padding-top: 28px; }
.ap-logo { margin-top: 4px; margin-bottom: 14px; }
.ap-title { margin: 0 0 4px; text-align: center; font-size: 1.05rem; font-weight: 700; color: #1c2536; }
.ap-account { margin: 0 0 16px; text-align: center; font-size: .8rem; color: #64748b; word-break: break-all; }
.ap-text { margin: 0 0 12px; font-size: .85rem; line-height: 1.65; color: #475569; }
.ap-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: #f1f5f9; font-size: .82rem; line-height: 1.6; color: #334155; }
.ap-note.warn { background: #fef3c7; color: #92400e; }
.ap-sub { margin: 18px 0 8px; font-size: .85rem; font-weight: 700; color: #1c2536; }
.ap-empty { margin: 0 0 8px; font-size: .8rem; color: #94a3b8; }
.ap-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 8px; }
.ap-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.ap-item + .ap-item { border-top: 1px solid #eef2f6; }
.ap-item-main { flex: 1; min-width: 0; }
.ap-item-name { font-size: .88rem; font-weight: 600; color: #1c2536; word-break: break-all; }
.ap-item-meta { font-size: .72rem; color: #64748b; line-height: 1.55; word-break: break-all; }
.ap-form { margin-top: 4px; }
.ap-input { height: 26px; font-size: .8rem; margin-bottom: 12px; }
.ap-scopes { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 2px 0 14px; }
.ap-scope { display: flex; gap: 6px; align-items: flex-start; font-size: .8rem; color: #334155; cursor: pointer; }
.ap-scope input { margin: 2px 0 0; }
.ap-hint { margin: 8px 0 0; text-align: center; font-size: .72rem; color: #94a3b8; }
.ap-created { margin: 16px 0 4px; padding: 14px 16px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; }
.ap-created-label { margin: 0 0 6px; font-size: .8rem; font-weight: 600; color: #475569; }
.ap-value { display: block; text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; color: #0f172a; padding: 8px 0; user-select: all; }
.ap-created-help { margin: 6px 0 10px; font-size: .75rem; line-height: 1.6; color: #64748b; }
.ap-row { display: flex; gap: 8px; justify-content: flex-end; }
.ap-langrow { margin: 14px 0 0; text-align: center; }
@media (max-width: 480px) { .ap-item { flex-wrap: wrap; } }
