/* 생년월일 카드 한 벌.
 *
 * birth-card.js 를 올리는 무료 입력·상품 상세·지갑·내 리포트·손님맞이가
 * 같은 간격과 입력 규격을 쓴다. 예전에는 webtoon.css, pages.css,
 * jeombang-core.css, jeombang-app.css 가 같은 선택자를 차례로 덮어 화면마다
 * 좌우 여백이 14~18px 로 달라졌다. frame.css 가 이 파일을 마지막에 불러
 * 소비 화면의 오래된 일반 폼 규칙보다 이 한 벌이 이긴다.
 */

:root {
    --birth-card-pad-block: 24px;
    --birth-card-pad-inline: 22px;
    --birth-card-flow-gap: 20px;
    --birth-card-field-gap: 18px;
}

.wallet-birth-card {
    position: relative;
    z-index: auto;
    display: grid;
    width: 100%;
    min-width: 0;
    margin: 20px 0 0;
    padding: var(--birth-card-pad-block) var(--birth-card-pad-inline);
    border: var(--bw) solid var(--edge-2);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--drop);
    backdrop-filter: none;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--birth-card-flow-gap);
}

/* 이미 카드인 화면(/saju/, /welcome/)에서는 공용 부품의 겉옷만 벗긴다. */
.card.wallet-birth-card.is-flat {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.birth-card-heading {
    display: grid;
    min-width: 0;
    gap: 8px;
}

.wallet-birth-card .birth-card-heading h2,
.wallet-birth-card .birth-card-heading p {
    margin: 0;
}

.wallet-birth-card .birth-card-heading h2 {
    color: var(--ink);
    font-family: "Gowun Dodum", serif;
    font-size: 23px;
    line-height: 1.4;
}

.wallet-birth-card .wt-form-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--birth-card-field-gap);
}

.wallet-birth-card .wt-form-grid .is-wide {
    grid-column: auto;
}

.wallet-birth-card .field,
.wallet-birth-card .saju-fieldset {
    display: grid;
    min-width: 0;
    margin: 0;
    gap: 8px;
}

.wallet-birth-card .saju-fieldset {
    padding: 0;
    border: 0;
}

.wallet-birth-card .field-label,
.wallet-birth-card .saju-fieldset legend {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
}

.wallet-birth-card .input {
    width: 100%;
    min-width: 0;
    min-height: 56px;
    margin: 0;
    padding: 11px 14px;
    border: var(--bw) solid var(--edge);
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background-color: var(--paper);
    font-family: inherit;
    font-size: 17px;
}

.wallet-birth-card select.input {
    padding-right: 34px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--edge-2) 50%),
        linear-gradient(135deg, var(--edge-2) 50%, transparent 50%);
    background-position: right 18px center, right 13px center;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.wallet-birth-card .input:focus {
    border-color: var(--red);
    background-color: var(--card);
    box-shadow: 0 0 0 3px rgb(245 52 60 / 12%);
}

.wallet-birth-card .birth-date-inputs {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1.28fr) repeat(2, minmax(0, 0.86fr));
    gap: 8px;
}

.wallet-birth-card .birth-date-part {
    display: block;
    min-width: 0;
    margin: 0;
}

.wallet-birth-card .birth-date-part .input {
    min-height: 60px;
    padding: 10px 28px 10px 8px;
    font-size: 19px;
    font-weight: 850;
    text-align: center;
}

.wallet-birth-card .saju-choice-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wallet-birth-card .saju-choice-grid label {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.wallet-birth-card .saju-choice-grid input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.wallet-birth-card .saju-choice-grid span {
    display: grid;
    min-height: 54px;
    border: var(--bw) solid var(--edge);
    border-radius: 12px;
    color: var(--ink);
    background: var(--card);
    place-items: center;
    font-size: 17px;
    font-weight: 800;
}

.wallet-birth-card .saju-choice-grid input:checked + span {
    border-color: var(--red);
    color: var(--red-2);
    background: var(--jb-me);
    box-shadow: var(--drop-sm);
}

.wallet-birth-card .saju-choice-grid input:focus-visible + span {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

.wallet-birth-card .saju-inline-check {
    display: flex;
    min-height: 48px;
    margin: 0;
    padding: 0 14px;
    border: var(--bw) solid var(--edge);
    border-radius: 12px;
    align-items: center;
    gap: 9px;
    color: var(--ink-2);
    background: var(--paper);
    font-size: 16px;
    font-weight: 700;
}

.wallet-birth-card .saju-inline-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--red);
}

.wallet-birth-card .wt-form-grid .fine-print {
    margin: 0;
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.6;
}

.wallet-birth-card > [data-buy-years],
.wallet-birth-card > .status-box,
.wallet-birth-card > .button {
    width: 100%;
    margin: 0;
}

.wallet-birth-card > .button {
    min-height: 54px;
    justify-content: center;
}

/* 저장 프로필 고르기. 이 부품도 birth-card.js 가 만들므로 같은 파일이 맡는다. */
.wallet-profile-picker {
    display: grid;
    min-width: 0;
    max-height: 300px;
    margin: 0;
    overflow-y: auto;
    gap: 8px;
}

.wallet-profile-picker .wbp-row {
    display: flex;
    min-height: 58px;
    padding: 10px 14px;
    border: var(--bw) solid var(--edge);
    border-radius: 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    background: var(--card);
    text-align: left;
    cursor: pointer;
}

.wallet-profile-picker .wbp-who {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.wallet-profile-picker .wbp-name {
    display: flex;
    align-items: center;
    gap: 7px;
}

.wallet-profile-picker .wbp-who b {
    font-size: 17px;
    font-weight: 800;
}

.wallet-profile-picker .wbp-who small {
    overflow: hidden;
    color: var(--ink-2);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-profile-picker .wbp-star {
    display: inline-block;
    padding: 1px 8px;
    border: 1.5px solid var(--red-2);
    border-radius: 999px;
    color: var(--red-2);
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    vertical-align: 2px;
}

.wallet-profile-picker .wbp-tick {
    position: relative;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: var(--bw) solid var(--edge);
    border-radius: 50%;
    background: var(--card);
}

.wallet-profile-picker .wbp-row[aria-pressed="true"] {
    border-color: var(--red);
    background: var(--jb-me);
}

.wallet-profile-picker .wbp-row[aria-pressed="true"] .wbp-tick {
    border-color: var(--red);
    background: var(--red);
}

.wallet-profile-picker .wbp-row[aria-pressed="true"] .wbp-tick::after {
    position: absolute;
    top: 3px;
    left: 7px;
    width: 6px;
    height: 11px;
    border-right: 2.5px solid var(--c-white);
    border-bottom: 2.5px solid var(--c-white);
    content: "";
    transform: rotate(45deg);
}

.wallet-birth-card .sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 340px) {
    :root { --birth-card-pad-inline: 18px; }

    .wallet-birth-card .birth-date-inputs { gap: 6px; }
    .wallet-birth-card .birth-date-part .input { font-size: 18px; }
}
