@charset "UTF-8";
/* ==========================================================
   美村PAY 実装用の追加スタイル（visonpay.css の後に読み込む）

   visonpay.css はデザインデータ（参考HTML）のまま変更しない。
   このファイルには、
     1) Moodle（Bootstrap）のスタイルとの調整
     2) PHPが出力するHTML（エラー表示・明細行・検索フォームなど）を、新デザインに合わせるスタイル
     3) 参考HTMLに無い画面部品（確認ダイアログ・ポイント選択行・店舗一覧など）
   を置く。
========================================================== */

:root {
  --vp-teal: #2F7F8E;
  --vp-teal-dark: #1D5F6E;
  --vp-orange: #D9660A;
  --vp-white: #fff;
  --vp-text: #000;
  --vp-sub: #555;
  --vp-border: #A2A2A2;
}

/* ---------- 1) Moodle・テーマとの調整 ---------- */
/* 利用者向け画面では、テーマの大きいフッターを出さず、美村PAYのフッター（.pay-footer）だけにする */
body.vp-payuser .l-footer_pagetop,
body.vp-payuser .l-footer_container,
body.vp-payuser .l-footer_copyright_text { display: none; }
body.vp-payuser .l-footer { background: none; padding: 0; margin: 0; min-height: 0; }
body.vp-payuser .l-footer_copyright { background: none; padding: 0; margin: 0; min-height: 0; }
body.vp-payuser #page { padding: 0; }
body.vp-payuser #region-main { padding: 0; border: 0; background: transparent; }

.pay-main { color: #000; font-size: 16px; }
.pay-main *, .pay-main *::before, .pay-main *::after { box-sizing: border-box; }
.pay-main p, .pay-main dl, .pay-main dd, .pay-main h2, .pay-main h3, .pay-main ul { margin-bottom: 0; }
.pay-main dt { font-weight: 400; }
.pay-main label { margin-bottom: 0; }
.pay-main a.pay-btn:hover, .pay-main a.pay-btn:focus { color: #fff; text-decoration: none; }
.pay-main a.pay-btn-outline:hover, .pay-main a.pay-btn-outline:focus { color: #2F7F8E; }
.pay-main a.pay-menu_item:hover, .pay-main a.pay-link_item:hover, .pay-main a.pay-choice:hover,
.pay-main a.pay-product:hover, .pay-main a.pay-history_item:hover, .pay-main a.pay-scan:hover { color: #000; text-decoration: none; }
.pay-main button.pay-btn-outline { border: 1px solid #2F7F8E; }
.pay-main button.pay-menu_item { border: 0; width: 100%; font-family: inherit; cursor: pointer; }
.pay-main form.pay-menu_form { display: contents; }
.pay-main .pay-input { background-color: #fff; color: #000; }
.pay-main textarea.pay-input { height: auto; padding: 10px 15px; }
.pay-pageHeader .m-pageHeader_title { color: #fff; margin: 0; }
.pay-main img { max-width: 100%; }
.pay-action > form { margin: 0; }
.pay-action > form + .pay-btn, .pay-action > .pay-btn + form, .pay-action > form + form { margin-top: 10px; }
.pay-action > form .pay-btn { margin-top: 0; }
.pay-action > form .pay-btn + .pay-btn { margin-top: 10px; }
.pay-btn-text { display: block; width: fit-content; margin: 16px auto 0; font-size: 14px; color: #555; text-decoration: underline; background: none; border: 0; cursor: pointer; }

/* ホーム：ポイント内訳の開閉（details を使う） */
.pay-point details > summary { list-style: none; cursor: pointer; }
.pay-point details > summary::-webkit-details-marker { display: none; }
.pay-point details[open] > summary .pay-point_toggle { rotate: 180deg; }
.pay-point_empty { padding: 14px 0 4px; font-size: 15px; color: #555; border-top: 1px dotted #6DC9DA; }
.pay-balance_user_image { background: rgba(255, 255, 255, 0.2); }

/* ---------- 2) メッセージ（PHPが出力する .vp-*） ---------- */
.vp-error, .vp-success, .vp-info, .vp-notice, .vp-age-warn, .vp-pending-banner, .vp-campaign-banner,
.pay-main .alert {
  display: block;
  border: 1px solid #DBD787;
  border-radius: 5px;
  background-color: #FFFEEA;
  padding: 13px 20px;
  font-size: 15px;
  line-height: 26px;
  color: #000;
  margin-bottom: 0;
}
.vp-error, .vp-notice-ng, .pay-main .alert-danger { background-color: #FFE5E5; border-color: #FF9D9D; color: #C62828; font-weight: 500; }
.vp-success, .vp-notice-ok, .pay-main .alert-success { background-color: #DBF5E0; border-color: #89D397; }
.vp-age-warn, .vp-pending-banner, .vp-campaign-banner, .pay-main .alert-warning { background-color: #FFF1E4; border-color: #FFB270; }
.vp-campaign-banner span { font-size: 13px; line-height: 20px; }
a.vp-pending-banner { text-decoration: none; }
.pay-card > .vp-error, .pay-card > .vp-success, .pay-card form > .vp-error { margin-bottom: 15px; }

/* ---------- 明細行（.vp-row → .pay-info_row と同じ見た目） ---------- */
.vp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-block: 8px;
  line-height: 25px;
  border-bottom: 1px dotted #6DC9DA;
}
.vp-row-label { flex-shrink: 0; max-width: 60%; }
.vp-row-val { font-weight: 500; text-align: right; word-break: break-all; }
.vp-row-val.big { font-family: "Inter", sans-serif; font-weight: 600; font-size: 24px; color: #2F7F8E; }
.vp-row-val.award, .vp-row-val.orange, .vp-row-val.plus { font-family: "Inter", sans-serif; font-weight: 600; font-size: 17px; color: #D9660A; }
.vp-row-val.minus { color: #C62828; }
.vp-row-note { flex-basis: 100%; text-align: right; font-size: 13px; line-height: 1.6; color: #555; }
.vp-campaign-name { font-size: 12px; color: #777; padding: 2px 0 6px; }
.vp-uuid, .pay-info_id { margin-top: 10px; font-size: 12px; line-height: 1.5; color: #777; word-break: break-all; }
.vp-note, .vp-amount-note { margin-top: 12px; font-size: 14px; line-height: 22px; color: #555; }
.vp-empty, .vp-usage-empty { padding: 30px 10px; text-align: center; color: #555; }
.vp-usage-empty { padding: 10px 0 0; text-align: left; }

/* ---------- バッジ ---------- */
.vp-badge-ok, .vp-badge-ng {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px;
  border: 1px solid #89D397; border-radius: 4px; background-color: #DBF5E0;
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.vp-badge-ng { border-color: #C9C9C9; background-color: #F0F0F0; color: #555; }
.vp-cancelled-tag, .vp-pending-tag, .pay-badge-wait {
  display: inline-flex; align-items: center; height: 20px; margin-left: 6px; padding: 0 6px;
  border: 1px solid #FF9D9D; border-radius: 4px; background-color: #FFE5E5; color: #C62828;
  font-size: 12px; font-weight: 700; vertical-align: 2px; white-space: nowrap;
}
.vp-pending-tag, .pay-badge-wait { border-color: #FFB270; background-color: #FFF1E4; color: #B45309; }
.vp-item-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: #2F7F8E; color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- ボタン（PHPが出力する .vp-btn-*） ---------- */
.vp-btn-orange, .vp-btn-ghost, .vp-btn-danger, .vp-btn-outline, .vp-btn-outline-danger {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 62px;
  margin-top: 10px; padding: 10px; border: 0; border-radius: 8px; background-color: #2F7F8E; color: #fff;
  font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.4; text-align: center;
  text-decoration: none; cursor: pointer; transition: opacity 0.2s ease;
}
.vp-btn-orange:hover, .vp-btn-danger:hover { opacity: 0.8; color: #fff; text-decoration: none; }
.vp-btn-ghost, .vp-btn-outline { background-color: #fff; border: 1px solid #2F7F8E; color: #2F7F8E; }
.vp-btn-danger { background-color: #E53935; }
.vp-btn-outline-danger { background-color: #fff; border: 1px solid #E53935; color: #E53935; }
.vp-btn-disabled, .vp-btn-orange:disabled { background-color: #8F8F8F; pointer-events: none; }
.vp-cancel-section { margin-top: 0; }
.vp-cancel-section form { margin: 0; }
.vp-cancel-note { margin: 10px 0 4px; font-size: 14px; line-height: 22px; color: #555; overflow-wrap: anywhere; }

/* ---------- 取引履歴 ---------- */
.pay-history_amount.is-point { color: #D9660A; }
.pay-history_more { display: block; width: 100%; min-height: 50px; border: 0; border-top: 1px dotted #6DC9DA; background: #fff; color: #2F7F8E; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pay-history_more:disabled { color: #999; }

/* ---------- 3) 支払い：ポイント種別の選択行（スイッチ） ---------- */
.pay-switch_body { display: flex; flex-direction: column; min-width: 0; }
.pay-switch_sub { font-size: 13px; line-height: 1.4; color: #555; font-weight: 400; }
.pay-switch_value.is-off { color: #999; }
.pay-switch_value small { font-size: 13px; font-weight: 500; }
.pay-shortfall { margin-top: 12px; padding: 10px 15px; border-radius: 5px; background: #FFE5E5; border: 1px solid #FF9D9D; color: #C62828; font-weight: 700; font-size: 15px; }
.pay-lead.warn strong { color: #E53935; }
.pay-btn-sub { display: block; width: 100%; height: 46px; margin-top: 12px; border: 1px solid #2F7F8E; border-radius: 6px; background: #fff; color: #2F7F8E; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }

/* QR読み取り
   html5-qrcode は「映像が本来の縦横比で表示されている」前提で読み取り範囲を計算するため、
   正方形固定や object-fit:cover で映像を変形・切り抜きしない（iPhoneで読み取れなくなる）。
   映像が届くまでの間は黒背景にする（白背景だと故障したように見えるため）。 */
.pay-camera { width: 100%; max-width: 300px; aspect-ratio: auto; min-height: 200px; background-color: #000; }
.pay-camera > div, .pay-camera video { width: 100% !important; }
.pay-camera video { height: auto !important; object-fit: fill; }
.pay-camera_loading { display: none; margin-top: 12px; text-align: center; color: #2F7F8E; font-weight: 700; }
#qr-result .vp-error { margin-top: 12px; }

/* 認証コード（6桁） */
.pay-code_input { background: #fff; color: #000; }

/* ---------- ふるさと納税：検索・絞り込み・店舗 ---------- */
.vp-filter { margin: 0; }
.vp-search { display: flex; gap: 8px; margin-bottom: 8px; }
.vp-search input[type=text] { flex: 1; min-width: 0; height: 42px; padding: 0 15px; border: 1px solid #A2A2A2; border-radius: 4px; font-size: 16px; background: #fff; }
.vp-search button { padding: 0 16px; background: #2F7F8E; color: #fff; border: 0; border-radius: 4px; font-size: 15px; font-weight: 700; cursor: pointer; }
.vp-check, .vp-bought { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 8px; font-size: 15px; cursor: pointer; }
.vp-check input, .vp-bought input { width: 20px; height: 20px; margin: 0; accent-color: #2F7F8E; -webkit-appearance: auto; appearance: auto; }
.vp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vp-tab { flex-shrink: 0; padding: 5px 14px; border-radius: 16px; background: #fff; color: #2F7F8E; border: 1px solid #2F7F8E; font-size: 14px; text-decoration: none; }
.vp-tab.active { background: #2F7F8E; color: #fff; }
.pay-product_meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; line-height: 1.5; color: #555; }
.vp-usage { border-bottom: 1px dotted #6DC9DA; padding-block: 10px; line-height: 25px; }
.vp-usage summary { cursor: pointer; }
.vp-usage-list { margin: 8px 0 0; padding-left: 20px; list-style: disc; line-height: 1.8; }
.vp-store { border-bottom: 1px dotted #6DC9DA; padding: 8px 0; }
.vp-store summary { cursor: pointer; }
.vp-store-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.vp-store-info dt { color: #555; }
.vp-store-info dd { margin: 0; word-break: break-all; }
.vp-store-info a, .vp-store-all { color: #1565C0; }
.vp-store-all { display: block; text-align: right; margin-top: 10px; font-size: 15px; font-weight: 700; text-decoration: none; }
.vp-store-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 4px #A3DBE5; }
.vp-store-card + .vp-store-card { margin-top: 10px; }
.vp-store-card-name { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.vp-store-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.vp-store-tag { font-size: 12px; font-weight: 700; color: #fff; background: #D9660A; border-radius: 10px; padding: 2px 8px; }

/* ---------- 確認ダイアログ（lib/pay_confirm_modal.php）を新デザインの配色に ---------- */
.pay-confirm-box { border-radius: 10px; }
.pay-confirm-msg { font-size: 16px !important; line-height: 1.6; }
.pay-confirm-btn { min-height: 50px; border-radius: 8px !important; font-size: 16px !important; font-family: inherit; }
.pay-confirm-btn-ghost { border: 1px solid #2F7F8E !important; color: #2F7F8E !important; }

/* ---------- その他 ---------- */
.pay-point_limit.vp-expiry--warn { color: #FF5959; }
.pay-list { margin: 10px 0 0; padding-left: 1.3em; list-style: disc; line-height: 1.7; font-size: 15px; }
.pay-list li + li { margin-top: 4px; }
.pay-card .pay-list + .pay-notice { margin-top: 15px; }
.pay-amount_qty { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-family: "Inter", sans-serif; font-weight: 600; font-size: 28px; -moz-appearance: textfield; }
.pay-amount_qty::-webkit-outer-spin-button, .pay-amount_qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vp-check span { flex: 1; line-height: 1.5; }
.vp-check { align-items: flex-start; }
.vp-check input { margin-top: 2px; flex-shrink: 0; }
.pay-history:has(#vp-tx-list:empty) { display: none; }
.pay-switch_label { line-height: 1.3; }
.pay-switch_body { flex: 1; }

/* ---------- ヘッダー：参考HTMLと同じ、白背景（利用者向け画面・ログイン画面のみ。main.css は変更しない） ---------- */
body.vp-payuser .l-header { background-color: #fff; }
body.vp-payuser .l-nav_list_item_anchor:hover,
body.vp-payuser .l-nav_task_help:hover { color: #2F7F8E; }
body.vp-payuser .l-nav_task_help img { background-color: transparent; border-radius: 0; padding: 0; }
body.vp-payuser .l-nav_task_login:hover { background-color: #2B6D79; color: #fff; }
@media print, screen and (min-width: 781px) {
  body.vp-payuser .l-nav_list_item_anchor,
  body.vp-payuser .l-nav_task_help { color: #000; }
  body.vp-payuser .l-nav_task_login { color: #fff; background-color: #2F7F8E; }
}

/* ---------- コードを見せて支払う（店舗が利用者のコードを読み取る方式） ---------- */
.pay-qr { width: 250px; max-width: 100%; aspect-ratio: 1; margin-inline: auto; padding: 12px; border: 1px solid #A2A2A2; border-radius: 4px; background: #fff; transition: opacity 0.2s ease; }
.pay-qr svg { display: block; width: 100%; height: 100%; }
.pay-qr.is-loading { opacity: 0.3; }
.pay-qr + .pay-camera_text { margin-top: 16px; }
.pay-scan-sub { margin-top: 10px; }
.pay-scan-sub .pay-scan_inner { height: 52px; font-size: 17px; border-width: 1px; }
.pay-lead.warn strong { color: #C62828; }
