/* =============================
   BASE.CSS
   공통 레이아웃 / 헤더 / 사이드레일 / 드로어 / 공통 컨텐츠 영역
   diagnosis / distribution / access / dashboard 공통 기반
   ============================= */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

:root {
  --header-h: 60px;
  --rail-w: 66px;
  --drawer-w: 200px;
  --panel-w: 360px;
  --ui-gap: 10px;
  --brand-green: #006537;

  --status-under: #006537;
  --status-fit: #b3bfba;
  --status-over: #e4007f;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* =============================
   상단 헤더
   ============================= */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e9e9e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 3000;
  backdrop-filter: blur(8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-menu-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 22px;
  cursor: pointer;
  border-radius: 10px;
  flex: 0 0 auto;
}

.header-menu-btn:hover {
  background: #f3f3f3;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.header-brand:hover {
  opacity: 0.88;
}

.header-logo {
  margin-top: 8px;
  width: 140px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.header-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: #6d6e71;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-contact-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  background: #006537;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

/* =============================
   좌측 아이콘 레일
   ============================= */
#icon-rail {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--rail-w);
  height: calc(100vh - var(--header-h));
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  z-index: 2700;
}

#menu-bar {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#menu-bar .menu {
  list-style: none;
  padding: 10px 0 0 0;
  margin: 0;
  width: 100%;
}

#menu-bar .menu-item {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#menu-bar .menu-item img {
  width: 24px;
  height: 24px;
  display: block;
  opacity: 0.65;
  filter: grayscale(100%) brightness(0);
}

#menu-bar .menu-item:hover {
  background: #f3f3f3;
}

#menu-bar .menu-item.active {
  background: #e5f2ec;
}

#menu-bar .menu-item.active img {
  opacity: 1;
  filter: none;
}

#drawer-footer {
  margin-top: auto;
  border-top: 1px solid #ececec;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.drawer-footer-item {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-footer-item img {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.7;
  filter: grayscale(100%) brightness(0);
}

.drawer-footer-item:hover {
  background: #f3f3f3;
}

/* =============================
   확장 드로어
   ============================= */
#sidebar-wrap.drawer {
  position: fixed;
  top: var(--header-h);
  left: var(--rail-w);
  width: var(--drawer-w);
  height: calc(100vh - var(--header-h));
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid #e8e8e8;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  z-index: 2600;
  display: flex;
  flex-direction: column;
}

#sidebar-wrap.drawer.open {
  transform: translateX(0);
}

#drawer-overlay {
  position: fixed;
  top: var(--header-h);
  left: var(--rail-w);
  width: calc(100% - var(--rail-w));
  height: calc(100vh - var(--header-h));
  background: transparent;
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

#sidebar {
  min-width: 0;
  min-height: 0;
  padding: 10px 0 0 0;
  overflow-y: auto;
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#sidebar-content {
  flex: 1 0 auto;
}

.drawer-menu-list {
  display: flex;
  flex-direction: column;
}

.drawer-link {
  display: flex;
  align-items: center;
  width: 100%;
  height: 64px;
  padding: 0 18px;
  color: #222;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.drawer-link.active {
  background: #e5f2ec;
  color: var(--brand-green);
}

.drawer-bottom-links {
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid #ececec;
  display: flex;
  flex-direction: column;
}

.drawer-bottom-links .drawer-link {
  height: 54px;
}

.drawer-divider {
  height: 1px;
  background: #e6e6e6;
  margin: 14px 0;
}

/* =============================
   공통 콘텐츠 영역
   ============================= */
.page-panel {
  display: none;
}

.page-panel.active {
  display: block;
}

#content-shell {
  position: absolute;
  top: var(--header-h);
  left: var(--rail-w);
  width: calc(100% - var(--rail-w));
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: #f7f7f5;
  display: none;
}

#app.drawer-open #content-shell {
  left: calc(var(--rail-w) + var(--drawer-w));
  width: calc(100% - var(--rail-w) - var(--drawer-w));
}

.content-page {
  display: none;
  padding: 28px;
}

.content-page.active {
  display: block;
}

.content-card {
  max-width: 980px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 28px;
}

.content-card h2 {
  margin: 0 0 16px 0;
  font-size: 28px;
  color: #222;
}

.content-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: #555;
}

.home-box {
  margin-top: 4px;
}

.home-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}

.home-text {
  font-size: 14px;
  line-height: 1.65;
  color: #555;
}

.drawer-page-title {
  font-size: 16px;
  font-weight: 500;
  color: #222;
  padding: 8px 0;
}

/* =============================
   공통 반응형
   ============================= */
@media (max-width: 1280px) {
  :root {
    --panel-w: 330px;
  }
}

@media (max-width: 900px) {
  .header-title {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --rail-w: 66px;
    --drawer-w: min(82vw, 320px);
  }
}

/* =============================
   접근성 분석 (준비중 화면)
   ============================= */

.access-empty-box {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70vh;
}

.access-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;

  padding: 100px 80px;
  text-align: center;

  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);

  width: 820px;
  height: 420px;
}

.access-title {
  font-size: 35px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #222;
}

.access-empty-text {
  font-size: 20px;
  line-height: 1.3;
  color: #9e9e9e;
  font-weight: 300;
}

/* =============================
   문의하기(Support Modal)
   ============================= */

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
}

.support-modal.is-open {
  display: block;
}

.support-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.38);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.support-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  height: auto;
  overflow-y: auto;

  background: rgba(255, 255, 255, 0.97);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);

  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) scale(0.92);
  transform-origin: center;
}

.support-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;

  border: none;
  background: transparent;
  color: #8b8b8b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.support-modal-close:hover {
  color: #333;
}

.support-modal-header {
  margin-bottom: 22px;
}

.support-modal-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  color: #222;
  letter-spacing: -0.02em;
}

.support-modal-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

.support-type-group {
  margin-bottom: 14px;
}

.support-type-label {
  font-size: 14px;
  font-weight: 700;
  color: #444;
  margin-bottom: 10px;
}

.support-type-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.support-type-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  min-height: 40px;
  padding: 0 14px;
  width: 150px;

  border: 1px solid #d6d6d6;
  border-radius: 999px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

.support-type-option input {
  margin: 0;
}

.support-type-option span {
  font-size: 14px;
  font-weight: 500;
}

.support-type-guide {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f7f7;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 16px;

  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.support-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.support-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.support-form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #444;
}

.support-form-field input,
.support-form-field select,
.support-form-field textarea {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font-size: 15px;
  color: #222;
  box-sizing: border-box;
  font-family: 'Pretendard', sans-serif;
  font-weight: 400;
}

.support-form-field input::placeholder,
.support-form-field textarea::placeholder {
  color: #9a9a9a;
}

.support-form-field input:focus,
.support-form-field select:focus,
.support-form-field textarea:focus {
  outline: none;
  border-color: #006537;
  box-shadow: 0 0 0 3px rgba(0, 101, 55, 0.12);
}

.support-form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.support-type-fields {
  display: none;
}

.support-type-fields.is-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-policy-box {
  margin-top: 2px;
  padding-top: 4px;
}

.support-policy-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.support-policy-check input {
  margin-top: 2px;
}

.support-policy-check span {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.support-policy-text {
  margin: 8px 0 0 26px;
  font-size: 13px;
  line-height: 1.5;
  color: #777;
}

.support-form-actions {
  position: sticky;
  bottom: 0;
  background: #f7f7f7;
  padding-top: 10px;
}

.support-btn {
  min-width: 110px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.support-btn-secondary {
  border: 1px solid #d2d2d2;
  background: #fff;
  color: #444;
}

.support-btn-primary {
  border: 1px solid #006537;
  background: #006537;
  color: #fff;
}

.support-btn-secondary:hover {
  background: #f7f7f7;
}

.support-btn-primary:hover {
  background: #00542d;
  border-color: #00542d;
}

@media (max-width: 640px) {
  .support-modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 22px 18px 18px;
    border-radius: 18px;
  }

  .support-modal-title {
    font-size: 24px;
  }

  .support-form-grid {
    grid-template-columns: 1fr;
  }

  .support-form-actions {
    flex-direction: column;
  }

  .support-btn {
    width: 100%;
  }
}

/* =============================
   ABOUT 전용 스크롤 해제
   ============================= */

#app.page-about {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

#app.page-about #content-shell {
  display: none !important;
}

#app.page-about #content-about {
  display: block !important;
}