/* SYSCARE 서브페이지 공용: 월간 점검표 체계의 양식 부품
   checksheet.css(토큰, 헤더, 버튼, 구역, 체크 칸, 표, 푸터, 하단 바) 뒤에 불러온다. */

/* ── 페이지 머리 ────────────────────────────────────────── */
.pagehead { padding-top: 40px; padding-bottom: 40px; }
.pagehead h1 { font-weight: 600; font-size: clamp(1.75rem, 7vw, 2.625rem); line-height: 1.22; letter-spacing: -0.03em; text-wrap: balance; max-width: 14em; }
.pagehead .lead { margin-top: 12px; max-width: 46ch; font-weight: 500; font-size: 1.0625rem; color: var(--ink-soft); }
.pagehead .hero-cta { margin-top: 22px; }
.pagehead .notice { margin-top: 16px; display: inline-block; }

/* 본문 폭을 줄여 읽기 편하게(양식, 약관) */
.narrow { max-width: 760px; }

/* ── 안내 칸 ────────────────────────────────────────────── */
.notice { border: var(--rule-thin) solid var(--line); background-color: var(--paper-shade); padding: 14px 16px; font-size: 0.9375rem; font-weight: 400; }
.notice strong { font-weight: 600; }
.notice + .notice { margin-top: 10px; }

/* ── 양식 ───────────────────────────────────────────────── */
.form { display: grid; gap: 22px; }
.row-2 { display: grid; gap: 22px; }
.field { display: grid; gap: 7px; }
.field > label, .group > legend { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.field .hint, .group .hint { font-size: 0.9375rem; color: var(--ink-soft); font-weight: 400; }
.req { color: var(--seal); font-weight: 600; }

.input, .select, .textarea {
    width: 100%; min-height: 52px; padding: 12px 14px;
    font: inherit; font-size: 1.0625rem; font-weight: 400; color: var(--ink);
    background-color: #fff; border: 1px solid var(--ink); border-radius: 0;
    appearance: none; -webkit-appearance: none;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #68718A; font-weight: 400; }
.select {
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314213D' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--seal); border-width: 2px; }
.error { font-size: 0.9375rem; font-weight: 600; color: var(--seal); }
.error[hidden], .hidden { display: none !important; }

/* 선택 묶음: 점검표의 체크 칸 */
.group { border: 0; min-width: 0; }
.group > legend { padding: 0; margin-bottom: 8px; }
.options { border-top: var(--rule-thin) solid var(--line); display: grid; }
/* .options.cols-2 는 768px 이상에서만 2열 */
.option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: var(--rule-thin) solid var(--line); font-weight: 500; cursor: pointer; }
.option input[type="checkbox"], .option input[type="radio"], .consent input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 30px; height: 30px; margin: 0; background-color: #fff; border: 1px solid var(--ink); border-radius: 0; cursor: pointer;
    background-repeat: no-repeat; background-position: center; background-size: 26px;
}
.option input[type="radio"] { border-radius: 50%; }
.option input:checked, .consent input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34' fill='none' stroke='%231F6F4A' stroke-width='4' stroke-linecap='square'%3E%3Cpath d='M7 17.5l7.5 7.5L29 6.5'/%3E%3C/svg%3E");
}
.option input:focus-visible, .consent input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.option:hover { background-color: var(--paper-shade); }

/* 동의 칸 */
.consent { display: flex; align-items: flex-start; gap: 12px; border: var(--rule) solid var(--ink); padding: 14px 16px; font-weight: 500; cursor: pointer; }
.consent a { font-weight: 600; }

/* 접어 둔 선택 항목(양식 안의 details) */
.fold { border: var(--rule-thin) solid var(--line); }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; background-color: var(--paper-shade); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary svg { flex: none; transition: transform 0.25s var(--ease-out); }
.fold[open] > summary svg { transform: rotate(45deg); }
.fold[open] > summary { border-bottom: var(--rule-thin) solid var(--line); }
.fold > .fold-body { padding: 18px 16px 20px; display: grid; gap: 20px; }

.form-actions { display: grid; gap: 12px; }
.form-actions .btn { width: 100%; min-height: 56px; font-size: 1.0625rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
button.btn { font-family: inherit; cursor: pointer; }

/* ── 표(약관, 비교) ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: var(--rule) solid var(--ink); }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.sheet-table th, .sheet-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: var(--rule-thin) solid var(--line); border-right: var(--rule-thin) solid var(--line); }
.sheet-table tr > :last-child { border-right: 0; }
.sheet-table tbody tr:last-child > * { border-bottom: 0; }
.sheet-table th { font-weight: 600; background-color: var(--paper-shade); white-space: nowrap; }

/* ── 읽는 글(약관) ──────────────────────────────────────── */
.prose { display: grid; gap: 14px; max-width: 70ch; }
.prose h2 { font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.02em; line-height: 1.3; margin-top: 26px; padding-top: 22px; border-top: var(--rule-thin) solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose ul { display: grid; gap: 6px; padding-left: 1.2em; list-style: square; }
.prose ol { display: grid; gap: 6px; padding-left: 1.4em; list-style: decimal; }
.prose a { font-weight: 500; }
.prose .table-wrap { max-width: none; }

/* ── 서비스 유형: 나란히 놓인 세 칸 ─────────────────────── */
.plans { display: grid; border: var(--rule) solid var(--ink); }
.plan { padding: 20px 16px 22px; border-bottom: var(--rule-thin) solid var(--line); display: grid; gap: 12px; align-content: start; }
.plan:last-child { border-bottom: 0; }
.plan h3 { font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.02em; }
.plan .price { font-weight: 600; font-size: 1.375rem; letter-spacing: -0.035em; line-height: 1.15; }
.plan .basis { font-size: 0.9375rem; color: var(--ink-soft); font-weight: 400; }
.plan .checks li { padding: 9px 0; grid-template-columns: 24px 1fr; column-gap: 10px; }
.plan .checks .box { width: 24px; height: 24px; }
.plan .checks strong { font-size: 1.0625rem; font-weight: 500; }
.plan .btn { width: 100%; margin-top: 4px; }

/* 산정 항목처럼 짧은 낱말을 늘어놓는 칸 */
.chips { display: grid; grid-template-columns: 1fr 1fr; border: var(--rule) solid var(--ink); }
.chips li { padding: 14px; font-weight: 600; border-right: var(--rule-thin) solid var(--line); border-bottom: var(--rule-thin) solid var(--line); }
.chips li:nth-child(2n) { border-right: 0; }
.chips li:nth-last-child(-n+2) { border-bottom: 0; }

dialog { margin: auto; }

/* ── 진행 표시(자가진단) ────────────────────────────────── */
.progress { border: var(--rule-thin) solid var(--line); height: 18px; background-color: #fff; }
.progress > i, .progress > div { display: block; height: 100%; background-color: var(--ok); transition: width 0.3s var(--ease-out); }

/* ── 결과 칸 ────────────────────────────────────────────── */
.result { border: var(--rule) solid var(--ink); }
.result > * { padding: 18px 16px; border-bottom: var(--rule-thin) solid var(--line); }
.result > :last-child { border-bottom: 0; }
.result .score { font-weight: 600; font-size: clamp(2.25rem, 10vw, 3.25rem); letter-spacing: -0.03em; line-height: 1; }
.grade { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid currentColor; font-weight: 600; }
.grade.is-low { color: var(--ok); }
.grade.is-medium { color: var(--ink); }
.grade.is-high { color: var(--seal); }

@media (prefers-reduced-motion: reduce) {
    .fold > summary svg, .progress > i, .progress > div { transition: none; }
}

@media (min-width: 768px) {
    .pagehead { padding-top: 72px; padding-bottom: 64px; }
    .pagehead .lead { font-size: 1.125rem; }
    .form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
    .options.cols-2 { grid-template-columns: 1fr 1fr; column-gap: 24px; }
    .form-actions { grid-template-columns: auto auto; justify-content: start; }
    .form-actions .btn { width: auto; padding: 0 46px; }
    .plans { grid-template-columns: repeat(3, 1fr); }
    .plan { padding: 26px 22px 28px; border-bottom: 0; border-right: var(--rule-thin) solid var(--line); }
    .plan:last-child { border-right: 0; }
    .chips { grid-template-columns: repeat(4, 1fr); }
    .chips li { padding: 18px; border-bottom: var(--rule-thin) solid var(--line); border-right: var(--rule-thin) solid var(--line); }
    .chips li:nth-child(2n) { border-right: var(--rule-thin) solid var(--line); }
    .chips li:nth-child(4n) { border-right: 0; }
    .chips li:nth-last-child(-n+2) { border-bottom: var(--rule-thin) solid var(--line); }
    .chips li:nth-last-child(-n+4) { border-bottom: 0; }
    .result > * { padding: 24px 24px; }
}

/* 글자를 키워 칸이 좁아진 경우(글자 100%에서는 걸리지 않는다): 산정 항목을 한 줄씩 쌓는다 */
@container (max-width: 14rem) {
    .chips { grid-template-columns: minmax(0, 1fr); }
    .chips li { border-right: 0; border-bottom: var(--rule-thin) solid var(--line); }
    .chips li:last-child { border-bottom: 0; }
}
