/* 사용 신청: 실제 사이트의 신청창(dialog.ap)과 하단 신청 칸(#download).
   화면은 실제 public/app.js가 그린다. 그래서 클래스 이름과 모습은 public/styles.css·site.css의 규칙을 그대로 옮겼다.
   이 페이지에 site.css 전체를 부르면 .reveal·.hero 등이 부딪혀서, 필요한 규칙만 범위를 좁혀 둔다. */
dialog.ap, #download {
  --bg: #fff;
  --soft: #fafaf9;
  --panel: #f6f6f5;
  --hover: #ececeb;
  --muted: #70706c;
  --strong: #181818;
  --accent: #181818;
  --on-accent: #fff;
  --blue: var(--cobalt);
  font: 16px/1.6 var(--font);
  color: var(--text);
  text-align: left;
}
dialog.ap *, dialog.ap *::before, #download * { box-sizing: border-box; }
:where(dialog.ap, #download) p, :where(dialog.ap, #download) h3 { margin: 0; }
dialog.ap [hidden], #download [hidden], [data-applicants-wrap][hidden], [data-footer][hidden] { display: none !important; }

/* 하단 칸: 왼쪽 안내, 오른쪽 신청 */
#download { scroll-margin-top: 84px; display: grid; grid-template-columns: .9fr 1.1fr; max-width: 920px; margin: 56px auto 0; background: var(--bg); border-radius: 22px; box-shadow: 0 24px 60px -20px rgba(20, 60, 120, .35); overflow: hidden; }
#download .info { padding: 32px; background: var(--soft); border-right: 1px solid var(--hair); }
#download .info h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
#download .info > p { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: var(--grey); }
#download .spec { list-style: none; display: grid; gap: 10px; margin: 20px 0 0; padding: 0; font-size: 13.5px; }
#download .spec li { display: flex; gap: 12px; }
#download .spec b { flex: none; width: 72px; font-weight: 500; color: var(--muted); }
#download .invite-how { margin-top: 22px; padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--hair); font-size: 13.5px; }
#download .invite-how b { font-weight: 600; color: var(--ink); }
#download .invite-how ol { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 18px; line-height: 1.6; color: var(--grey); }
#download .guide-link { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--blue); text-decoration: none; }
#download .win { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); font-size: 14px; color: var(--grey); }
#download .win button { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--blue); font: 500 14px var(--font); cursor: pointer; }
#download .panel { padding: 32px; min-width: 0; }
#download .loading { color: var(--muted); }
/* 숫자는 바로 위 누적 신청 표시에 이미 있다 */
#download .ap-badge { display: none; }

/* 양식 공통 */
:where(dialog.ap, #download) .form { display: grid; gap: 14px; }
:where(#download) .form h3 { font-size: 19px; font-weight: 600; color: var(--ink); }
:where(#download) .form .sub { margin: 2px 0 8px; font-size: 15px; line-height: 1.75; color: var(--muted); }
:where(dialog.ap, #download) .field { display: grid; gap: 6px; }
:where(dialog.ap, #download) .field label { font-size: 14px; font-weight: 600; color: var(--strong); }
:where(dialog.ap, #download) .field label small { font-weight: 400; color: var(--muted); }
:where(dialog.ap, #download) .field input, :where(#download) .field textarea { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 15.5px/1.5 var(--font); }
:where(#download) .field textarea { min-height: 84px; resize: vertical; }
:where(#download) .field select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 15.5px var(--font); }
:where(dialog.ap, #download) .field input:focus, :where(#download) .field textarea:focus, :where(#download) .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
:where(#download) .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
:where(dialog.ap, #download) .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; color: var(--text); cursor: pointer; }
:where(dialog.ap, #download) .check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
:where(dialog.ap, #download) .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; transition: transform .15s var(--glide), opacity .15s var(--glide); }
:where(dialog.ap, #download) .btn:hover { opacity: .88; }
:where(dialog.ap, #download) .btn:active { transform: translateY(1px); }
:where(dialog.ap, #download) .btn[disabled] { opacity: .45; cursor: default; }
:where(dialog.ap, #download) .btn.ghost { background: transparent; color: var(--strong); border-color: var(--line); }
:where(dialog.ap, #download) .btn.ghost:hover { background: var(--hover); opacity: 1; }
:where(#download) .btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
:where(#download) .form .btn { width: 100%; margin-top: 4px; }
:where(dialog.ap, #download) .notice { padding: 16px 18px; border-radius: 12px; font-size: 15px; line-height: 1.6; border: 1px solid var(--line); background: var(--panel); }
:where(dialog.ap, #download) .notice.ok { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
:where(dialog.ap, #download) .notice.err { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }
:where(dialog.ap, #download) .notice b { display: block; margin-bottom: 2px; color: var(--strong); }
:where(#download) .direct-box { display: grid; gap: 16px; align-content: start; }
:where(#download) .direct-box .btn { min-height: 56px; font-size: 17px; }
:where(#download) .form-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 12px; background: var(--soft); border: 1px solid var(--hair); }
:where(#download) .form-tabs button { padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--grey); font: 500 14.5px var(--font); cursor: pointer; }
:where(#download) .form-tabs button[aria-selected="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* 신청 화면(.apf): 신청창과 하단 칸이 같이 쓴다 */
.apf { display: grid; gap: 14px; text-align: left; }
.apf .field input { height: 50px; font-size: 16px; }
.apf .form-tabs { margin-bottom: 4px; }
.ap-steps { display: flex; gap: 6px; margin: 2px 0; }
dialog.ap .ap-steps { margin-right: 44px; }
.ap-steps i { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.ap-steps i.on { background: var(--ink); }
.ap-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--grey); }
.ap-badge i { width: 7px; height: 7px; border-radius: 50%; background: #2f9e62; }
.apf .ap-title { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.apf .ap-title-sm { font-size: 19px; }
.apf .ap-title:focus { outline: none; }
.apf .ap-lead { margin: -6px 0 4px; font-size: 15px; line-height: 1.7; color: var(--grey); }
.apf .ap-lead a { color: var(--blue); }
.ap-agree { display: grid; gap: 10px; margin-top: 2px; }
.ap-agree .check { font-size: 14.5px; }
.ap-agree .check a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ap-agree .check small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.6; color: var(--grey); }
.apf .btn { width: 100%; min-height: 54px; font-size: 16.5px; border-radius: 14px; }
.apf .btn[aria-busy="true"]::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: apspin .7s linear infinite; }
@keyframes apspin { to { transform: rotate(360deg); } }
.ap-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--grey); }
.ap-foot a { color: var(--blue); text-decoration: none; }
.ap-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #eef8f2; }
.ap-done b { display: block; font-size: 16px; color: var(--ink); }
.ap-done span { font-size: 14px; line-height: 1.6; color: var(--grey); }
.ap-done .ok { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: #2f9e62; color: #fff; font-size: 14px; font-weight: 700; }
.apf .ap-q { margin: 2px 0 -6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 14px var(--font); cursor: pointer; transition: background .15s var(--glide), border-color .15s var(--glide); }
.ap-chips button:hover { background: var(--soft); }
.ap-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ap-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 신청창 */
dialog.ap { border: 0; padding: 30px 28px 24px; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; border-radius: 22px; background: var(--bg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
dialog.ap::backdrop { background: rgba(17, 17, 16, .42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
dialog.ap[open] { animation: ap-in .38s var(--glide); }
@keyframes ap-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
html:has(dialog.ap[open]) { overflow: hidden; }
.ap-x { position: absolute; top: 14px; right: 14px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--grey); font-size: 17px; cursor: pointer; }
.ap-x:hover { color: var(--ink); }

@media (max-width: 860px) {
  #download { grid-template-columns: 1fr; margin-top: 40px; }
  #download .info { border-right: 0; border-bottom: 1px solid var(--hair); }
  #download .info, #download .panel { padding: 22px 18px; }
}
@media (max-width: 700px) {
  dialog.ap { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  dialog.ap::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
  dialog.ap[open] { animation-name: ap-up; }
  @keyframes ap-up { from { transform: translateY(100%); } }
  .ap-x { top: 10px; right: 10px; }
  /* 16px보다 작으면 iPhone이 입력할 때 화면을 확대한다 */
  #download .field input, #download .field textarea, #download .field select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.ap[open] { animation: none; }
  .ap-chips button, dialog.ap .btn, #download .btn { transition: none; }
}

/* 어드민의 베타 문구로 바뀌면 머리 버튼 글자가 길어진다 */
.t5-head [data-cta] { white-space: nowrap; }
@media (max-width: 350px) {
  .t5-head [data-cta] { padding: 0 12px; font-size: 13.5px; }
}

/* 바로 아래 자주 묻는 질문과 간격이 벌어지지 않게 */
#apply { padding-bottom: 64px; }
@media (max-width: 860px) { #apply { padding-bottom: 48px; } }
