@charset "utf-8";
/*!
 * 産前・産後期間計算ツール
 *
 * 見た目は日本マクドナルド健康保険組合の同ツール（Vuetify 製）に合わせている。
 * Vuetify 本体は読み込まず、必要な部品の見た目と動きだけをここで再現する。
 *
 * すべてのセレクタを .cbc 配下に閉じてある。サイト側の既存 CSS と
 * 衝突しないよう、要素セレクタ単独での指定は行わない。
 *
 * フォントと文字サイズ
 *   サイト本文（ＭＳ Ｐゴシック）を継承すると参考サイトと字面が変わるため、
 *   .cbc で Vuetify と同じ指定（Roboto → 日本語はメイリオ等）と 16px 基準を持つ。
 *   内側の文字サイズはすべて em（16px 基準。参考サイトの px ÷ 16）。
 */

.cbc {
  --cbc-prenatal: #1976d2;
  --cbc-postnatal: #4caf50;
  --cbc-mark: #e00;
  --cbc-birth-mark: #f90;
  --cbc-total: #424242;
  --cbc-leave: #ff5722;
  --cbc-error: #ff5252;
  --cbc-ink: #333;
  --cbc-strong: rgba(0, 0, 0, 0.87);
  --cbc-muted: rgba(0, 0, 0, 0.6);
  --cbc-line: rgba(0, 0, 0, 0.42);
  --cbc-divider: rgba(0, 0, 0, 0.12);
  --cbc-result-bg: #f9fbe7;
  --cbc-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  --cbc-ease: cubic-bezier(0.25, 0.8, 0.5, 1);

  font-family: Roboto, 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'メイリオ',
    Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cbc-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

.cbc *,
.cbc *::before,
.cbc *::after {
  box-sizing: inherit;
}

.cbc-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  flex: none;
  vertical-align: middle;
}

/* ---------------------------------------------------------------- *
 * カード
 * ---------------------------------------------------------------- */

.cbc-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--cbc-shadow);
}

/* ---------------------------------------------------------------- *
 * 入力カード
 * ---------------------------------------------------------------- */

.cbc-form {
  padding: 2em 2em 0.5em;
}

/* 画面に入るまで隠し、入ったらふわっと出す（v-lazy + fade-transition） */
.cbc-form.is-lazy {
  opacity: 0;
  transition: opacity 0.3s var(--cbc-ease);
}

.cbc-form.is-lazy.is-shown {
  opacity: 1;
}

.cbc .cbc-lead {
  margin: 0 0 1em;
  font-size: 1.25em;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.0125em;
  color: var(--cbc-strong);
}

.cbc-form-body {
  width: 83.333%;
  margin: 0 auto;
}

/* ラジオボタン */

.cbc-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1em;
  margin: 0 0 1.5em;
}

.cbc-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  line-height: 1.25;
  color: var(--cbc-ink);
  cursor: pointer;
}

.cbc-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.cbc-radio-mark {
  position: relative;
  width: 1.25em;
  height: 1.25em;
  border: 2px solid rgba(0, 0, 0, 0.54);
  border-radius: 50%;
  flex: none;
  transition: border-color 0.3s var(--cbc-ease);
}

/* フォーカス・ホバー時の薄い円（Vuetify の選択コントロール） */
.cbc-radio-mark::before {
  content: '';
  position: absolute;
  inset: -0.6em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s var(--cbc-ease);
}

.cbc-radio:hover .cbc-radio-mark::before {
  opacity: 0.04;
}

.cbc-radio input:focus-visible + .cbc-radio-mark::before {
  opacity: 0.12;
}

.cbc-radio-mark::after {
  content: '';
  position: absolute;
  inset: 0.17em;
  border-radius: 50%;
  background: var(--cbc-prenatal);
  transform: scale(0);
  transition: transform 0.3s var(--cbc-ease);
}

.cbc-radio input:checked + .cbc-radio-mark {
  color: var(--cbc-prenatal);
  border-color: var(--cbc-prenatal);
}

.cbc-radio input:checked + .cbc-radio-mark::after {
  transform: scale(1);
}

/* 日付欄（下線だけのテキストフィールド。ラベルは欄の中から上へ浮く） */

.cbc-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
}

.cbc-field-icon {
  display: inline-flex;
  margin-top: 1.1em;
  color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
  transition: color 0.3s var(--cbc-ease);
}

.cbc-field-icon .cbc-icon {
  width: 1.5em;
  height: 1.5em;
}

.cbc-field-control {
  position: relative;
  flex: 1;
  min-width: 0;
  padding-top: 0.75em;
}

.cbc .cbc-label {
  position: absolute;
  top: 1.1em;
  left: 0;
  max-width: 100%;
  margin: 0;
  font-size: 1em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--cbc-muted);
  transform-origin: top left;
  transition: transform 0.3s var(--cbc-ease), color 0.3s var(--cbc-ease);
  pointer-events: none;
}

.cbc-field.is-filled .cbc-label,
.cbc-field:focus-within .cbc-label {
  max-width: 133%;
  transform: translateY(-1.1em) scale(0.75);
}

.cbc-input-wrap {
  position: relative;
}

/* フォーカス時に中央から広がる下線 */
.cbc-input-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cbc-prenatal);
  transform: scaleX(0);
  transition: transform 0.3s var(--cbc-ease);
  pointer-events: none;
}

.cbc-field:focus-within .cbc-input-wrap::after {
  transform: scaleX(1);
}

.cbc-input {
  position: relative;
  display: block;
  width: 100%;
  min-height: 2em;
  margin: 0;
  padding: 0.5em 0 0.25em;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.25;
  color: var(--cbc-strong);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--cbc-line);
  border-radius: 0;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* 未入力のあいだは「年/月/日」の書式表示を隠し、ラベルだけを見せる */
.cbc-field:not(.is-filled):not(:focus-within) .cbc-input {
  color: transparent;
}

.cbc-input:hover {
  border-bottom-color: var(--cbc-strong);
}

/* 欄のどこを押してもピッカーが開くよう、標準のアイコンを全面に透明で広げる */
.cbc-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  cursor: pointer;
}

.cbc-field:focus-within .cbc-label,
.cbc-field:focus-within .cbc-field-icon {
  color: var(--cbc-prenatal);
}

.cbc .cbc-field-message {
  min-height: 1.75em;
  margin: 0.5em 0 0;
  font-size: 0.75em;
  line-height: 1.2;
  color: var(--cbc-error);
}

.cbc-field.is-error .cbc-label,
.cbc-field.is-error .cbc-field-icon {
  color: var(--cbc-error);
}

.cbc-field.is-error .cbc-input-wrap::after {
  background: var(--cbc-error);
  transform: scaleX(1);
}

/* ボタン */

.cbc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
  padding: 2em 0;
}

.cbc-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 2.5714em;
  padding: 0 1.4286em 0 1.1429em;
  font-family: inherit;
  font-size: 0.875em;
  font-weight: 500;
  letter-spacing: 0.0892857em;
  line-height: 1;
  border: 0;
  border-radius: 4px;
  box-shadow: var(--cbc-shadow);
  cursor: pointer;
  transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.cbc-btn .cbc-icon {
  width: 1em;
  height: 1em;
}

/* ホバー時の薄い重ね色 */
.cbc-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.6, 1);
  pointer-events: none;
}

.cbc-btn:hover:not(:disabled)::before {
  opacity: 0.08;
}

.cbc-btn:focus-visible::before {
  opacity: 0.24;
}

.cbc-btn:hover:not(:disabled) {
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
}

.cbc-btn:focus {
  outline: none;
}

.cbc-btn-primary {
  color: #fff;
  background: var(--cbc-prenatal);
}

.cbc-btn-plain {
  color: var(--cbc-strong);
  background: #f5f5f5;
}

.cbc-btn:disabled {
  color: rgba(0, 0, 0, 0.26);
  background: rgba(0, 0, 0, 0.12);
  box-shadow: none;
  cursor: default;
}

/* 押した位置から広がる波紋（v-ripple） */
.cbc-ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0);
  animation: cbc-ripple 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

@keyframes cbc-ripple {
  0% {
    opacity: 0.25;
    transform: scale(0.05);
  }
  60% {
    opacity: 0.25;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* 未計算の入力があるときの合図 */
.cbc-btn.is-pulse .cbc-icon {
  border-radius: 50%;
  animation: cbc-pulse 1.2s infinite;
}

@keyframes cbc-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* ---------------------------------------------------------------- *
 * 結果カード（開閉は JS の Web Animations で行う）
 * ---------------------------------------------------------------- */

.cbc-result {
  margin-top: 2em;
  background: var(--cbc-result-bg);
}

.cbc .cbc-result-title {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0.6667em;
  padding: 1.3333em 0;
  font-size: 1.5em;
  font-weight: 500;
  line-height: 1.3333;
  letter-spacing: normal;
  color: var(--cbc-strong);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--cbc-divider);
}

/* サイト側の見出し装飾を打ち消す */
.cbc .cbc-result-title::before,
.cbc .cbc-result-title::after {
  content: none;
}

.cbc-result-icon {
  width: 1.4em;
  height: 1.4em;
  color: #424242;
}

.cbc-result-body {
  padding: 0 1em 1em;
}

/* 結果の各行 */

.cbc .cbc-summary {
  margin: 0 0 2em;
  padding: 0;
}

.cbc-summary-row {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.75em 0.75em;
  border-bottom: 1px solid var(--cbc-divider);
}

.cbc .cbc-summary-term {
  flex: 0 0 25%;
  margin: 0;
  padding: 0;
}

.cbc .cbc-summary-value {
  flex: 1;
  margin: 0;
  padding: 0;
  font-size: 1.25em;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.0125em;
  color: var(--cbc-strong);
}

.cbc-summary-extended {
  font-size: 0.8em;
  font-weight: 400;
}

/* チップ */

.cbc-chip {
  display: inline-flex;
  align-items: center;
  height: 2.2857em;
  padding: 0 0.8571em;
  font-size: 0.875em;
  font-weight: 700;
  line-height: 1.4286;
  white-space: nowrap;
  color: #fff;
  border-radius: 1.1429em;
}

.cbc-chip.is-pre {
  background: var(--cbc-prenatal);
}

.cbc-chip.is-post {
  background: var(--cbc-postnatal);
}

.cbc-chip.is-total {
  background: var(--cbc-total);
}

.cbc-chip.is-leave {
  background: var(--cbc-leave);
}

.cbc-legend {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
  margin: 0 0.75em 0.75em;
}

.cbc-legend .cbc-chip {
  font-weight: 400;
}

/* 対象外の案内 */

.cbc .cbc-notice {
  margin: 1.5em 0.75em;
  padding: 0.9em 1.1em;
  line-height: 1.7;
  color: #8a5a00;
  background: #fff8e1;
  border-left: 4px solid #ffb300;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- *
 * 月カレンダー
 * ---------------------------------------------------------------- */

.cbc-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5em 2.5em;
  align-items: start;
  padding: 0.75em;
}

.cbc-month {
  padding: 0 1em 1em;
}

.cbc .cbc-month-label {
  margin: 0;
  padding: 0.8em 0;
  font-size: 1.25em;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.0125em;
  text-align: center;
  color: var(--cbc-strong);
  background: none;
  border: 0;
}

.cbc .cbc-month-label::before,
.cbc .cbc-month-label::after {
  content: none;
}

.cbc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cbc-weekday {
  padding: 0 0.25em;
  font-size: 0.6875em;
  line-height: 2;
  letter-spacing: 0.0091em;
  text-align: center;
  color: var(--cbc-ink);
}

.cbc-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 2.25em;
}

.cbc-day.is-outside {
  visibility: hidden;
}

.cbc-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6667em;
  height: 2.6667em;
  font-size: 0.75em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.0893em;
  color: var(--cbc-strong);
  border-radius: 50%;
}

.cbc-day-num.is-pre,
.cbc-day-num.is-post {
  color: #fff;
}

.cbc-day-num.is-pre {
  background: var(--cbc-prenatal);
}

.cbc-day-num.is-post {
  background: var(--cbc-postnatal);
}

.cbc-day-mark {
  position: relative;
  z-index: 1;
  margin-top: -0.5em;
  padding: 0 0.25em;
  font-size: 0.75em;
  line-height: 1.6667;
  letter-spacing: 0.0083em;
  white-space: nowrap;
  color: #fff;
  background: var(--cbc-mark);
  border-radius: 4px;
}

.cbc-day-mark + .cbc-day-mark {
  margin-top: 0.1em;
}

.cbc-day-mark.is-birth {
  background: var(--cbc-birth-mark);
}

/* 読み上げ専用 */
.cbc-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- *
 * スマートフォン
 * ---------------------------------------------------------------- */

@media (max-width: 640px) {
  .cbc-form {
    padding: 1.25em 1em 0.25em;
  }

  .cbc .cbc-lead {
    font-size: 1.125em;
  }

  .cbc-form-body {
    width: 100%;
  }

  .cbc .cbc-result-title {
    font-size: 1.25em;
    padding: 1.2em 0;
  }

  .cbc-result-body {
    padding: 0 0.5em 0.75em;
  }

  .cbc-summary-row {
    padding: 0.6em 0.25em;
  }

  .cbc .cbc-summary-term {
    flex-basis: 42%;
  }

  .cbc .cbc-summary-value {
    font-size: 1.125em;
  }

  .cbc-legend {
    justify-content: center;
  }

  .cbc-months {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25em;
    padding: 0.5em 0.25em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cbc *,
  .cbc *::before,
  .cbc *::after {
    transition: none !important;
  }

  .cbc-btn.is-pulse .cbc-icon {
    animation: none;
  }
}

@media print {
  .cbc-form.is-lazy {
    opacity: 1;
  }
}
