:root {
    --brand: #D52F83;
    --brand-deep: #A31E62;
    --bg: #FDF6FA;
    --surface: #FFFFFF;
    --text: #212121;
    --muted: #5A5A5A;
    --line: #E8C7D9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    word-break: keep-all;
    line-height: 1.5;
}

body {
    background: var(--bg);
    color: var(--text);
    max-width: 480px;
    margin: 0 auto;
}

header img {
    width: 100%;
    height: auto;
    display: block;
}

main {
    padding: 0 16px 40px;
}

main h2 {
    margin: 1.25rem 0 0.5rem;
    text-align: center;
    color: var(--brand);
    font-size: 1.375rem;
}

/* 배너와 제목 사이 소개 문단 — 새 색을 만들지 않고 .agreeBox 의 낮춘 톤(연한 배경·테두리·muted 글자색)을 그대로 가져온다 */
.introBox {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.introBox p {
    margin-bottom: 0.625rem;
}

.introBox p:last-child {
    margin-bottom: 0;
}

.introBox strong {
    color: var(--text);
}

form#actionForm section {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

section h3 {
    color: var(--brand-deep);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

section h3 .req {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    vertical-align: middle;
}

section h4 {
    color: var(--brand-deep);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

input[type="text"],
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
}

/* 선택지는 기본이 1열이다. 라벨이 긴 문항에 열 수를 안 붙이고 지나가도
   가로로 넘치지 않는 쪽이 기본값이어야 한다. 다열은 문항마다 켜는 것이다. */
.radioWrap {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
    column-gap: 0.5rem;
}

/* minmax(0, 1fr) 의 0 이 핵심이다. 그냥 1fr 로 두면 열의 최소 크기가 min-content 라,
   띄어쓰기 없이 긴 한글 라벨이 열 폭을 안에서 밀어내 표 전체가 화면 밖으로 나간다. */
.radioWrap.col2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radioWrap.col3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0.25rem; }
.radioWrap.col3 p label { padding-left: 0.25rem; }

/* 화면이 아주 좁으면 3열은 '미성년자' 같은 네 글자 라벨도 담지 못한다. 그때는 2열로 내린다. */
@media (max-width: 359px) {
    .radioWrap.col3 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.5rem; }
    .radioWrap.col3 p label { padding-left: 0.375rem; }
}

.radioWrap p {
    min-height: 44px;
    min-width: 0;               /* 칸이 내용 때문에 넓어지지 않게 — 위 minmax(0,…) 와 한 쌍이다 */
    display: flex;
    align-items: center;
}

.radioWrap input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;             /* 라벨이 길어져도 동그라미가 찌그러지지 않게 */
    cursor: pointer;
}

.radioWrap p label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 44px;           /* 칸 전체가 손가락에 닿는 영역이 된다 */
    padding-left: 0.375rem;
    cursor: pointer;
    /* 마지막 안전장치. 예상 못 한 긴 라벨이 들어와도 화면 밖으로 나가는 대신 접힌다.
       break-word 는 구형 브라우저용 폴백이고, anywhere 는 열 폭 계산에도 반영된다. */
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
}

.subQuestion {
    border-left: 3px solid var(--brand);
    padding: 0.75rem 0 0.75rem 1rem;
    margin: 0 0 1rem;
    background: var(--surface);
    border-radius: 0 0.5rem 0.5rem 0;
}

.etcWrap {
    margin-top: 0.75rem;
}

.etcWrap label {
    display: block;
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.375rem;
}

/* 약관은 접지 않고 전문을 편다. 접어 두면 그 아래 붙어 있던 동의 칸이 스크롤 안에 숨는다. */
.agreeBox {
    background: var(--bg);      /* 흰 카드가 아니라 '읽는 문서'로 한 단 낮춘다 */
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.agreeBox h3 {
    color: var(--text);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.agreeBox p {
    margin-bottom: 0.625rem;
}

/* 동의 체크는 읽는 영역이 아니라 행동 영역이다. 약관 박스 밖으로 꺼내
   흰 배경 + 브랜드 테두리로 분리하고, 바로 아래 신청 버튼과 한 덩어리로 읽히게 한다. */
.agreeConfirm {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 2px solid var(--brand);
    border-radius: 0.75rem;
}

.agreeConfirm input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 auto;
    cursor: pointer;
}

.agreeConfirm label[for="agree"] {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-left: 0.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.btnSubmit {
    display: block;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 0.75rem;
    background: var(--brand);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
}

#completeMsg {
    text-align: center;
    color: var(--brand-deep);
    padding: 2.5rem 1rem;
    font-size: 1.0625rem;
}
