/* =========================================================================
 *  육아휴직 통장 미리보기 — style.css
 *  모바일 우선. 통장(passbook)을 모티프로 한 파스텔 톤.
 * ========================================================================= */

:root {
  --paper:      #EDF3F6;
  --card:       #FFFFFF;
  --ink:        #22384A;
  --ink-soft:   #61798B;
  --ink-faint:  #93A7B4;
  --line:       #DCE6EC;

  --mint:       #57BFA0;
  --mint-deep:  #2E9A7C;
  --mint-soft:  #E1F3EC;
  --lilac:      #A99BE6;
  --butter:     #F5C462;
  --peach:      #F79C8B;
  --stamp:      #E4645A;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;

  --shadow: 0 2px 0 rgba(34, 56, 74, .04), 0 10px 24px -14px rgba(34, 56, 74, .30);

  --display: 'Jua', 'IBM Plex Sans KR', sans-serif;
  --body: 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'IBM Plex Sans KR', monospace;
}

* { box-sizing: border-box; }

/* display:flex 를 쓰는 요소에서도 hidden 속성이 먹도록 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

/* ---------------------------------------------------------------- 히어로 */
.hero {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 22px 26px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--mint-deep);
}

.hero__title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.22;
  letter-spacing: -.01em;
}

.hero__lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ----------------------------------------------------------------- 카드 */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px 18px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 19px;
}

.section-title--outside { padding: 0 6px; }

/* --------------------------------------------------------------- 입력폼 */
.field-group {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}
.field-group:last-of-type { margin-bottom: 18px; }

.field-group__legend {
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
}

.field { display: block; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field__hint {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

input[type="date"],
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: #F7FAFC;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  appearance: none;
  transition: border-color .15s, background .15s;
}

input[type="date"] { min-height: 48px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2361798B' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
  padding-right: 40px;
}

input:focus-visible, select:focus-visible, button:focus-visible, .carousel:focus-visible {
  outline: 3px solid rgba(87, 191, 160, .45);
  outline-offset: 2px;
  border-color: var(--mint);
  background: #fff;
}

.money, .months { position: relative; display: flex; align-items: center; }

.money input { padding-right: 44px; font-family: var(--mono); font-weight: 600; letter-spacing: .01em; }
.months input { padding-right: 56px; font-family: var(--mono); font-weight: 600; }

.money__unit, .months__unit {
  position: absolute;
  right: 15px;
  font-size: 14px;
  color: var(--ink-faint);
  pointer-events: none;
}

.chips { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }

.seg { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }

.chip {
  flex: 1 1 auto;
  padding: 8px 4px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #F2F7F9;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { background: var(--mint-soft); }
.chip[aria-pressed="true"] {
  background: var(--mint-soft);
  border-color: var(--mint);
  color: var(--mint-deep);
}
.chip:disabled {
  opacity: .38;
  cursor: not-allowed;
  background: #F2F7F9;
  border-color: transparent;
  color: var(--ink-faint);
}

/* 육아휴직 기간 상한 안내 (1년 6개월 연장 요건) */
.limit-hint {
  display: block;
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}
.limit-hint--on {
  color: var(--mint-deep);
  font-weight: 600;
}

/* 체크박스 */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--mint-deep); }

/* 토글 스위치 */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0 2px;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__track {
  flex: 0 0 auto;
  width: 52px; height: 31px;
  background: #DDE7EC;
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.switch__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 25px; height: 25px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(34,56,74,.25);
  transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--mint); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(21px); }
.switch input:focus-visible + .switch__track { outline: 3px solid rgba(87,191,160,.45); outline-offset: 2px; }

.switch__label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.switch__label small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--ink-faint); }

#spouse-fields { margin-top: 18px; }

.error {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #FDECEA;
  color: #B23A2E;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r-md);
}

.submit {
  width: 100%;
  padding: 17px;
  font-family: var(--display);
  font-size: 18px;
  color: #fff;
  background: var(--mint-deep);
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform .12s, background .15s;
}
.submit:hover { background: #268067; }
.submit:active { transform: scale(.985); }

/* --------------------------------------------------------------- 통장 */
.result { margin-top: 26px; }

.passbook {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 26px 20px 24px;
  margin-bottom: 16px;
  overflow: hidden;
}

/* 통장 윗면의 미싱선 */
.passbook::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--mint) 0 7px, transparent 7px 14px);
  opacity: .55;
}

.passbook__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.passbook__name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

.passbook__tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mint-deep);
  background: var(--mint-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.passbook__total {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  word-break: break-all;
}
.passbook__total em {
  font-family: var(--display);
  font-style: normal;
  font-size: 19px;
  margin-left: 4px;
  color: var(--ink-soft);
}

.passbook__sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.stamp {
  position: absolute;
  right: 16px; bottom: 16px;
  width: 76px; height: 76px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  transform: rotate(-11deg);
  opacity: .9;
}
.stamp__big { font-family: var(--display); font-size: 21px; line-height: 1; }
.stamp__small { font-size: 10.5px; font-weight: 600; margin-top: 3px; }

.notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #FFF6E3;
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: #8A6320;
}

/* --------------------------------------------------- 인구감소지역 안내 */
.area-help {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.area-help summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 0;
  color: var(--ink-soft);
  font-weight: 500;
}
.area-help summary::-webkit-details-marker { display: none; }
.area-help summary::before { content: '＋ '; color: var(--mint-deep); }
.area-help[open] summary::before { content: '－ '; }

.area-group {
  padding: 10px 12px;
  background: #F4F8FA;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  line-height: 1.6;
}
.area-group b {
  display: block;
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-bottom: 4px;
}
.area-group span { color: var(--ink-faint); font-size: 11.5px; }
.area-group em { font-style: normal; color: var(--mint-deep); font-weight: 600; }
.area-help > div > p {
  margin: 6px 2px 0;
  font-size: 11.5px;
  line-height: 1.55;
}

/* ----------------------------------------------------- 첫 입금 안내 */
.gap-card { background: #FFF9EC; }
.gap-line {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.gap-date {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: #8A6320;
}
.gap-wait {
  font-size: 12px;
  font-weight: 600;
  color: #8A6320;
  background: #FBEBC8;
  padding: 3px 10px;
  border-radius: 999px;
}
.gap-desc { margin: 0; font-size: 13.5px; color: #8A6320; }

/* --------------------------------------------------------- 입금 기준 안내 */
.viewnote {
  margin: 0 0 16px;
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: #E2ECF1;
  border-radius: var(--r-md);
}
.viewnote b { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------- 이미지 저장 */
.share { margin-top: 20px; }
.share__btn {
  width: 100%;
  padding: 16px;
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--mint);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.share__btn:hover { background: var(--mint-soft); }
.share__btn:active { transform: scale(.985); }
.share__btn:disabled { opacity: .6; cursor: default; }
.share__hint {
  margin: 10px 4px 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}

#share-canvas { position: fixed; left: -20000px; top: 0; width: 1080px; height: 1350px; }

/* --------------------------------------------------------------- 차트 */
.chart-wrap { position: relative; height: 240px; }

/* 기간이 길면 여러 컷으로 나눠 보여준다 */
.chart-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 0 12px;
}
.chart-nav__btn {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  background: #F1F6F9;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chart-nav__btn:hover:not(:disabled) { background: var(--mint-soft); color: var(--ink); }
.chart-nav__btn:disabled { opacity: .35; cursor: default; }
.chart-nav__range {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

.chart-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.chart-dots button {
  width: 7px; height: 7px;
  padding: 0;
  background: #CBD9E1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.chart-dots button[aria-current="true"] { background: var(--mint); transform: scale(1.35); }

.chart-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  list-style: none; margin: 16px 0 0; padding: 0;
  font-size: 12.5px; color: var(--ink-soft);
}
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------ 월별 내역 */
.ledger { width: 100%; border-collapse: collapse; }

.ledger__month td { padding: 0; }

.ledger__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
}

.ledger__label {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.ledger__label small {
  display: block;
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-top: 1px;
}

.ledger__amount {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--mint-deep);
}

.ledger__parts {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 9px 0 14px;
  border-bottom: 1px solid var(--line);
}

.part {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #F4F8FA;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.part i { width: 7px; height: 7px; border-radius: 50%; }
.part b { font-family: var(--mono); font-weight: 600; color: var(--ink); }

.ledger__total th, .ledger__total td {
  padding-top: 16px;
  font-size: 15px;
}
.ledger__total th { text-align: left; font-family: var(--display); font-weight: 400; }
.ledger__total td { text-align: right; font-family: var(--mono); font-weight: 600; }

.disclaimer {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------- 카드뉴스 */
.cardnews { margin-top: 34px; }

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 6px 6px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.carousel::-webkit-scrollbar { display: none; }

.info-card {
  flex: 0 0 82%;
  scroll-snap-align: center;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px 20px 24px;
}

.info-card__icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-soft);
  border-radius: 14px;
  font-size: 22px;
  margin-bottom: 14px;
}

.info-card__title {
  margin: 0 0 9px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.35;
}

.info-card__body { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.info-card__body + .info-card__body { margin-top: 7px; }

.dots { display: flex; justify-content: center; gap: 7px; margin-top: 14px; }
.dots button {
  width: 7px; height: 7px; padding: 0;
  border: 0; border-radius: 50%;
  background: #C9D8E0;
  cursor: pointer;
  transition: all .2s;
}
.dots button[aria-current="true"] { background: var(--mint-deep); width: 20px; border-radius: 999px; }

/* ---------------------------------------------------------------- 출처 */
.sources {
  margin-top: 40px;
  padding: 22px 18px;
  background: #E4EDF2;
  border-radius: var(--r-lg);
}
.sources__title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-soft);
}
.sources ul { list-style: none; margin: 0; padding: 0; }
.sources li { margin-bottom: 11px; font-size: 12.5px; line-height: 1.5; }
.sources a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink-faint); }
.sources a:hover { color: var(--mint-deep); border-color: var(--mint); }
.sources li span { display: block; color: var(--ink-faint); font-size: 11.5px; }
.sources__stamp {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #D2E0E7;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* -------------------------------------------------------------- 데스크탑 */
@media (min-width: 560px) {
  body { font-size: 15.5px; }
  .hero { padding-top: 56px; }
  .hero__title { font-size: 44px; }
  .card, .passbook { padding-left: 26px; padding-right: 26px; }
  .passbook__total { font-size: 40px; }
  .info-card { flex-basis: 70%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
