/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   macOS 스타일 (챗봇 제외 전 페이지)
   배경화면 + 유리(글래스모피즘) 창 + Dock
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body.mac {
  --accent: #1d1d1f;          /* 포인트 컬러 1개 — 여기만 바꾸면 전체 반영 */
  --label: #1d1d1f;
  --label-2: #86868b;
  --sep: rgba(0, 0, 0, 0.08);
  --fill: #f2f2f4;            /* 아이콘 칸·버튼 바탕 */
  --line: rgba(0, 0, 0, 0.08);
  --blur: saturate(180%) blur(20px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, sans-serif;
  color: var(--label);
  letter-spacing: -0.2px;
  min-height: 100dvh;
  background: #ffffff;
}
body.mac.accent-blue { --accent: #0071e3; }

/* ── 창 ── */
.desk { padding: 12px 10px 104px; }
.window {
  max-width: 560px; margin: 0 auto; background: #fff;
  border-radius: 14px; overflow: clip;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
}
.titlebar {
  position: sticky; top: 0; z-index: 10; height: 44px;
  display: grid; grid-template-columns: 80px 1fr 80px; align-items: center;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--sep);
}
.lights { display: flex; gap: 8px; padding-left: 14px; }
.lights a, .lights i {
  width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.lights .r { background: #ff5f57; } .lights .y { background: #febc2e; } .lights .g { background: #28c840; }
.lights svg { width: 8px; height: 8px; opacity: 0; color: rgba(0, 0, 0, 0.55); }
.lights:hover svg { opacity: 1; }
.tb-back { justify-self: start; margin-left: 4px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--label); }
.tb-back:hover { background: rgba(0, 0, 0, 0.05); }
.tb-back svg { width: 24px; height: 24px; }
body.no-dock .desk { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.wtitle { text-align: center; font-size: 13.5px; font-weight: 600; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { padding: 20px 16px 28px; }

/* ── 프로필 (Apple ID 헤더식) ── */
.m-profile { text-align: center; padding: 8px 0 22px; }
.m-profile .avatar {
  width: 84px; height: 84px; margin: 0 auto 12px; font-size: 32px;
  background: var(--label); box-shadow: none;
}
.m-profile .name { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.m-profile .handle { color: var(--label-2); font-size: 14px; }
.m-profile .bio { color: #424245; font-size: 14.5px; margin-top: 10px; white-space: pre-line; line-height: 1.5; }
.m-profile .row { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }

/* ── 버튼 (macOS) ── */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--fill); color: var(--accent);
}
.m-btn.primary { background: var(--accent); color: #fff; }
.m-btn svg { width: 16px; height: 16px; }

/* ── 그룹 목록 (시스템 설정식) ── */
.m-sec { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 22px 12px 7px; display: flex; justify-content: space-between; align-items: baseline; }
.m-sec a { color: var(--accent); font-weight: 500; padding: 8px 0 8px 12px; margin: -8px 0; }
.m-group { background: #f5f5f7; border-radius: 14px; overflow: hidden; }
.m-row { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 58px; position: relative; transition: background 0.12s; }
.m-row:hover { background: rgba(0, 0, 0, 0.025); }
.m-row:active { background: rgba(0, 0, 0, 0.06); }
.m-row + .m-row::before { content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: 0.5px solid var(--sep); }
.m-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: #fff; color: var(--accent); box-shadow: 0 0 0 1px var(--line);
}
.m-ico svg { width: 19px; height: 19px; }
.m-row .txt { flex: 1; min-width: 0; padding: 10px 0; }
.m-row .t { display: block; font-size: 15.5px; font-weight: 500; }
.m-row .s { display: block; font-size: 12.5px; color: var(--label-2); margin-top: 1px; }
.m-row .chev { color: #c7c7cc; font-size: 22px; font-weight: 300; line-height: 1; }

/* ── 앱스토어식 템플릿 행 ── */
.app-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; }
.app-row + .app-row::before { content: ""; position: absolute; top: 0; right: 0; left: 84px; border-top: 0.5px solid var(--sep); }
.app-icon {
  width: 56px; height: 56px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 28px;
  background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-row .txt { flex: 1; min-width: 0; }
.app-row .t { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row .s { display: block; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row .k { display: block; font-size: 11.5px; color: var(--label-2); margin-top: 2px; }
.get { flex: none; min-width: 72px; height: 30px; padding: 0 14px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--accent); font-size: 14px; font-weight: 700; display: grid; place-items: center; }

/* ── Dock ── */
.dock {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.dock a { position: relative; display: grid; place-items: center; transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1.3); transform-origin: bottom; }
.dock a:hover { transform: scale(1.18) translateY(-4px); }
.dock .di {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--fill); color: var(--label); box-shadow: none;
}
.dock .di svg { width: 23px; height: 23px; }
.dock a.on .di { background: var(--accent); color: #fff; }
.dock .sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--sep); }
.dock a.on::after { content: ""; position: absolute; bottom: -5px; width: 4px; height: 4px; border-radius: 50%; background: var(--label-2); }
.dock a .tip {
  position: absolute; bottom: 64px; padding: 3px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  background: #1d1d1f; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.dock a:hover .tip { opacity: 1; }

body.mac .footer { color: var(--label-2); }
body.mac .demo-bar { background: #f5f5f7; color: #86868b; font-weight: 500; }

@media (min-width: 700px) {
  .desk { padding-top: 48px; }
  .win-body { padding: 28px 32px 36px; }
}

/* ━━━━━━━━━━ 하위 페이지 공통 ━━━━━━━━━━ */
.tb-action { justify-self: end; margin-right: 10px; opacity: 0; transform: scale(0.9); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.tb-action.show { opacity: 1; transform: none; pointer-events: auto; }
.tb-action .get { height: 26px; min-width: 0; font-size: 13px; padding: 0 12px; background: var(--accent); color: #fff; box-shadow: none; }

/* 탭 선택 (macOS segmented control) */
.m-seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.m-seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--label); }
.m-seg button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.m-tags { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px 0 4px; }
.m-tags::-webkit-scrollbar { display: none; }
.m-tag { flex: none; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 13px; color: var(--label); box-shadow: inset 0 0 0 1px var(--line); }
.m-tag.on { background: var(--accent); color: #fff; box-shadow: none; }
.m-empty { text-align: center; color: var(--label-2); padding: 40px 0; font-size: 14px; }

/* 앱스토어식 상세 */
.as-head { display: flex; gap: 16px; align-items: flex-start; }
.as-head .app-icon { width: 108px; height: 108px; border-radius: 24px; font-size: 56px; }
.as-head .info { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 108px; }
.as-head h2 { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.4px; }
.as-head .sub { color: var(--label-2); font-size: 14px; margin-top: 3px; }
.as-head .act { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 10px; }
.as-head .act .get { background: var(--accent); color: #fff; box-shadow: none; min-width: 88px; }
.as-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 6px; padding: 12px 0; border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); }
.as-stats div { text-align: center; position: relative; }
.as-stats div + div::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; border-left: 1px solid var(--sep); }
.as-stats small { display: block; font-size: 11px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.2px; }
.as-stats b { display: block; font-size: 17px; font-weight: 700; margin-top: 2px; color: var(--label); }
.as-desc { font-size: 15px; line-height: 1.6; color: #333336; margin-top: 16px; }
.m-list { list-style: none; }
.m-list li { display: flex; gap: 10px; padding: 12px 14px; font-size: 14.5px; line-height: 1.45; position: relative; }
.m-list li + li::before { content: ""; position: absolute; top: 0; left: 38px; right: 0; border-top: 1px solid var(--sep); }
.m-list li::after { content: none; }
.m-list .ck { flex: none; width: 16px; color: var(--accent); font-weight: 700; }
.m-note { font-size: 12.5px; color: var(--label-2); line-height: 1.7; padding: 12px 14px; }
.m-note a { color: var(--accent); text-decoration: underline; }

/* 신청 페이지 */
.m-hero { background: #f5f5f7; border-radius: 14px; padding: 20px 18px; }
.m-hero h2 { font-size: clamp(19px, 5.9vw, 23px); white-space: nowrap; font-weight: 700; line-height: 1.3; letter-spacing: -0.5px; word-break: keep-all; }
.m-hero p { font-size: 14.5px; color: #424245; margin-top: 8px; line-height: 1.55; word-break: keep-all; }
/* 단계: 동그라미 ─ 선 ─ 동그라미 */
.m-steps { display: flex; align-items: flex-start; margin-top: 18px; padding: 0 4px; }
.m-step { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--label); }
.m-step b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.m-step-line { flex: 1; height: 2px; margin: 14px -8px 0; border-radius: 1px; background: #d2d2d7; }
/* 예시 신청 (실제 요청 아님) */
.m-examples { list-style: none; }
.m-examples li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.45; color: #333336; position: relative; }
.m-examples li + li::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--sep); }
.m-ex-tag { flex: none; width: 40px; box-sizing: border-box; text-align: center; margin-top: 1px; padding: 2px 0; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line); font-size: 11px; font-weight: 600; color: var(--label-2); }
/* 안내 */
.m-note-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: #424245; position: relative; }
.m-note-row + .m-note-row::before { content: ""; position: absolute; top: 0; left: 42px; right: 0; border-top: 1px solid var(--sep); }
.m-note-row b { color: var(--label); font-weight: 600; }
.m-note-row > span:first-child { display: grid; flex: none; margin-top: 1px; }
.m-note-row svg { width: 18px; height: 18px; color: var(--label-2); }
.m-sec-sub { font-weight: 400; margin-left: auto; }
/* 신청 페이지: 섹션 제목을 입력칸 라벨과 같은 왼쪽 선에 맞춤 */
.req-page .m-sec { margin-left: 2px; margin-right: 2px; }
#reqForm > .m-sec { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--sep); }
.m-field-first { margin-top: 0; }
#reqForm > .m-sec + .m-field { margin-top: 0; }
.m-count { text-align: right; }
.m-hint.err { color: #d70015; }
.m-switch-row .req { margin-left: 2px; }
.m-field { margin-top: 18px; }
.m-field > label, .m-label { display: block; font-size: 13px; font-weight: 600; color: var(--label); margin: 0 2px 7px; }
.m-field .opt { color: var(--label-2); font-weight: 400; }
.req { color: #d70015; font-weight: 600; }
.m-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.m-toggles button { height: 32px; padding: 0 13px; border-radius: 8px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); color: var(--label); }
.m-toggles button.on { background: var(--accent); color: #fff; box-shadow: none; }
.m-hint { font-size: 12px; color: var(--label-2); margin: 6px 2px 0; }

/* 스위치 */
.m-switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 13.5px; color: #333336; line-height: 1.45; position: relative; cursor: pointer; }
.m-switch-row + .m-switch-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--sep); }
.m-switch-row span { flex: 1; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 26px; border-radius: 13px; background: #e3e3e8; position: relative; cursor: pointer; transition: background 0.2s; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1.2); }
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(16px); }
.switch:focus-visible { outline: 3px solid rgba(0, 113, 227, 0.35); outline-offset: 2px; }

/* 입력칸·버튼 (macOS) */
body.mac .input, body.mac .textarea {
  height: 40px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, 0.12); background: #fff;
  font-size: 15px; padding: 0 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
body.mac .textarea { height: auto; min-height: 140px; padding: 10px 12px; line-height: 1.5; }
body.mac .input:focus, body.mac .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); }
body.mac.accent-blue .input:focus, body.mac.accent-blue .textarea:focus { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); }
body.mac .btn { height: 44px; border-radius: 10px; font-size: 15.5px; font-weight: 600; background: var(--accent); }
body.mac .btn:disabled { background: #e3e3e8; color: #a1a1a6; }
body.mac .btn.ghost { background: var(--fill); color: var(--label); border: 0; }
body.mac .toast { background: rgba(29, 29, 31, 0.92); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: 10px; font-weight: 500; }

/* 결제 시트 */
body.mac .sheet-bg { background: rgba(0, 0, 0, 0.25); }
body.mac .sheet { border-radius: 16px 16px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12); }
body.mac .sheet-head { margin-bottom: 14px; }
body.mac .sheet-head h3 { font-size: 16px; font-weight: 700; }
body.mac .sheet-head .icon-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--label-2); }
body.mac .sheet-head .icon-btn svg { width: 15px; height: 15px; }
body.mac .order-sum { background: #f5f5f7; border-radius: 12px; }
body.mac .order-sum .mini { background: #fff !important; box-shadow: 0 0 0 1px var(--line); }
body.mac .sheet .field { margin-bottom: 8px; }
body.mac .sheet .sec-label { font-size: 13px; font-weight: 600; margin: 16px 2px 8px; }
body.mac .phone-box { height: 40px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, 0.12); padding: 0 12px; }
body.mac .phone-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); }
body.mac .phone-box input { font-size: 15px; }
body.mac .phone-wrap .flag { font-size: 13px; font-weight: 500; color: var(--label-2); }
body.mac .seg-opt { height: 40px; border-radius: 10px; font-size: 14.5px; border: 1px solid var(--line); }
body.mac .seg-opt.on { background: var(--accent); border-color: var(--accent); }
body.mac .agree { font-size: 12.5px; color: var(--label-2); }
body.mac .agree input { accent-color: var(--accent); width: 16px; height: 16px; }
body.mac .bank-box { background: #f5f5f7; border-radius: 12px; padding: 8px 14px; }
body.mac .bank-row { font-size: 14.5px; padding: 8px 0; }
body.mac .bank-row + .bank-row { border-top: 1px solid var(--sep); }
body.mac .copy-btn { background: #fff; border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: 6px; font-weight: 600; color: var(--accent); }
body.mac .done-ico { width: 52px; height: 52px; font-size: 24px; background: var(--fill); color: var(--label); }
body.mac .done-title { font-size: 19px; font-weight: 700; }
body.mac .done-sub { font-size: 13.5px; color: var(--label-2); }
body.mac .notice { background: #f5f5f7; color: #424245; border-radius: 12px; font-size: 13.5px; }
body.mac .notice b { color: var(--label); }

@media (min-width: 700px) {
  /* PC에선 창 가운데 팝업 */
  body.mac .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 440px; max-height: 88vh; border-radius: 16px;
    transform: translate(-50%, -46%) scale(0.97); opacity: 0; pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--line);
  }
  body.mac .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
}
