/* bodyのレイアウトを調整し、ヘッダー用のスペースを確保 */
body {
  font-family: sans-serif;
  background-color: #F0F4F8;
  margin: 0;
  padding-top: 70px; /* ヘッダーの高さ分、上部に余白を設ける */
}

/* --- ヘッダー --- */
.main-header {
  background-color: #fff;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed; /* 画面上部に固定 */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-sizing: border-box; /* paddingを含めてwidthを100%にする */
  display: flex;
  align-items: center;
}

.header-logo {
  height: 45px; /* ロゴの高さを調整 */
}

.header-logo img {
  height: 100%;
  width: auto;
}

/* コンテナを中央に配置 */
#app-container {
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  text-align: left;
  border-bottom: 3px solid #007bff;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  text-align: left;
  border-left: 5px solid #007bff;
  padding-left: 10px;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

input,
select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

button {
  background-color: #007bff;
  color: #fff;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.table-container {
  margin-top: 2rem;
  overflow-x: auto; /* テーブルがはみ出す場合に横スクロール */
}

.mypage-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e0e0e0;
  text-align: left;
  font-size: 0.95rem;
}

.mypage-table th,
.mypage-table td {
  padding: 1rem;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}

.mypage-table th {
  background-color: #f7f7f7;
  font-weight: bold;
  width: 25%; /* thの幅を調整 */
}

.mypage-table td {
  background-color: #fff;
  line-height: 1.5;
}

.service-section {
  margin-bottom: 2rem;
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.service-section p {
    text-align: left;
    margin-left: 15px;
}

#customer-info-section {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mypage-table .col-ntt-id      { width: 25%; }
.mypage-table .col-plan        { width: 35%; }
.mypage-table .col-status      { width: 15%; }
.mypage-table .col-details     { width: 25%; text-align: center; }

.modal {
  display: none; 
  position: fixed; 
  z-index: 2000; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.6); 
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto; 
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}
.modal-table th, .modal-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}
.modal-table th {
  width: 35%;
  background-color: #f2f2f2;
}

#user-info {
  display: flex; 
  align-items: center; 
  margin-left: auto; 
}

#user-email {
  margin-right: 1rem; 
}

.modal-tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1rem;
}

.tab-link {
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  cursor: pointer;
  margin-right: 5px;
  font-size: 0.95rem;
  color: #555;
  transition: all 0.2s ease-in-out;
  margin-bottom: -2px; /* 下線をタブリストの枠線に重ねるため */
}

.tab-link.active {
  border-bottom-color: #007bff;
  font-weight: bold;
  color: #000;
}

.tab-link:hover {
  color: #000;
  border-bottom-color: #aaa;
}

.tab-content {
  display: none;
  padding-top: 1rem;
}

.tab-content.active {
  display: block;
}

/* =================================== */
/* ===== グローバルメニュー用の追記 ===== */
/* =================================== */

/* マイページ全体のレイアウト */
#mypage-wrapper {
  display: flex; /* Flexboxを有効化 */
  min-height: calc(100vh - 70px);
}

/* 左側のナビゲーションメニュー */
#global-nav {
  width: 250px; /* メニューの幅を固定 */
  flex-shrink: 0; /* コンテンツが増えてもメニュー幅を維持 */
  background-color: #F5F7FA; /* 全体背景（土台） */
  padding: 1rem 0;
  box-sizing: border-box;
  border-top-left-radius: 12px; /* 左上の角を丸める */
  border-top-right-radius: 12px; /* 右上の角を丸める */
}

/* 右側のメインコンテンツエリア */
#main-content {
  flex-grow: 1; /* 残りのスペースをすべて埋める */
  min-width: 0; /* flexアイテムの縮小問題を解決 */
  padding: 2rem;
}

/* メニューボタンのスタイル */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px; /* アイコンとテキストの間隔 */
  width: calc(100% - 28px); /* 左右の余白を考慮 */
  margin: 0 auto 6px auto; /* 中央寄せ */
  padding: 10px 14px;
  background-color: #FFFFFF; /* 通常時: 白 */
  color: #333;
  border: none;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08); /* 軽く浮かせる */
  transition: background 0.2s ease, color 0.2s ease;
  box-sizing: border-box;
}

.nav-btn:hover {
  background: #E8F0FE; /* hover 時: 淡いブルー */
}

.nav-btn.active {
  background: #007bff; /* active（選択中）: ブランドの青 */
  color: #FFFFFF; /* active時 文字色: 白 */
  font-weight: bold;
}

/* アイコンのスタイル調整 */
.nav-btn .material-icons {
  font-size: 22px; /* アイコンのサイズ */
  vertical-align: middle;
}

/* コンテンツの表示・非表示 */
.content-block {
  display: none; /* デフォルトで非表示 */
}

.content-block.active {
  display: block; /* activeクラスが付いたブロックのみ表示 */
}


/* =================================== */
/* ===== ログインページ用の追記 ===== */
/* =================================== */

/* ログインボタンを中央寄せにする */
.login-button-container {
  text-align: center;
  margin-top: 1.5rem; /* ボタンの上のスペース */
}

/* パスワードリセットリンク */
.password-reset-container {
  text-align: center;
  margin-top: 1rem;
}

.password-reset-container a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
}

.password-reset-container a:hover {
  text-decoration: underline;
}

/* ===================================== */
/* ===== 請求・支払いページ用の追記 ===== */
/* ===================================== */

/* 2カラムレイアウト */
.billing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2つのカラムを均等に分割 */
  gap: 2rem; /* カラム間のスペース */
}

.billing-column-left,
.billing-column-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* セクション間のスペース */
}

.billing-section {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* カード情報リスト */
.card-list-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 10px;
  font-family: monospace;
}

.card-list-item .brand-icon {
  width: 40px;
  margin-right: 15px;
}

.card-list-item .card-details {
  flex-grow: 1;
}

.card-list-item .default-badge {
  font-size: 0.8rem;
  font-weight: bold;
  color: #28a745;
  margin-left: 1rem;
}

/* カードアクションボタン "..." */
.card-actions-button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 10px;
  color: #6c757d;
}

/* アクションメニュー */
.card-actions-menu {
  position: absolute;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 100;
}

.card-actions-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.75rem 1rem;
  color: #333;
}

.card-actions-menu button:hover {
  background-color: #f7f7f7;
}

/* Stripe Payment Element */
#payment-form {
  margin-top: 1rem;
}

#payment-element {
  margin-bottom: 1.5rem;
}

.stripe-button {
  background-color: #5469d4;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: block;
  width: 100%;
}

.stripe-button:hover {
  background-color: #4355b8;
}

.stripe-button .spinner.hidden {
  display: none;
}

#payment-message {
  color: #fa755a;
  font-size: 0.9rem;
  margin-top: 1rem;
}

#payment-message.hidden {
  display: none;
}

/* 請求履歴テーブル */
#invoice-history-table-container .mypage-table th,
#invoice-history-table-container .mypage-table td {
  text-align: center;
}

/* ============================================= */
/* ===== クレジットカード追加機能用のスタイル ===== */
/* ============================================= */

/* カード追加フォームを囲むコンテナ */
#add-card-form-container {
  background-color: #f7f9fc;
  padding: 2rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  border: 1px solid #e0e6f0;
  display: none; /* 初期状態では非表示 */
}

/* 「クレジットカードを追加」ボタン */
#add-card-button {
  background-color: #28a745; /* 見やすい緑色 */
  color: white;
  font-weight: bold;
  padding: 10px 15px;
  margin-top: 1.5rem;
  display: inline-block;
  text-align: center;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#add-card-button:hover {
  background-color: #218838;
}

/* Payment Element内の送信ボタン */
#payment-form-submit-button {
  background-color: #007bff; /* 青色 */
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: block;
  width: 100%;
  transition: background-color 0.2s ease-in-out;
}
#payment-form-submit-button:hover {
  background-color: #0056b3;
}
#payment-form-submit-button:disabled {
  background-color: #a9b2d3;
  cursor: not-allowed;
}

/* 送信中のスピナー */
.spinner, .spinner:before, .spinner:after {
  border-radius: 50%;
}
.spinner {
  color: #ffffff;
  font-size: 22px;
  text-indent: -99999px;
  margin: 0px auto;
  position: relative;
  width: 20px;
  height: 20px;
  box-shadow: inset 0 0 0 2px;
  transform: translateZ(0);
}
.spinner:before, .spinner:after {
  position: absolute;
  content: '';
}
.spinner:before {
  width: 10.4px;
  height: 20.4px;
  background: #007bff; /* ボタンの色に合わせる */
  border-radius: 20.4px 0 0 20.4px;
  top: -0.2px;
  left: -0.2px;
  transform-origin: 10.4px 10.2px;
  animation: loading 2s infinite ease 1.5s;
}
.spinner:after {
  width: 10.4px;
  height: 10.2px;
  background: #007bff; /* ボタンの色に合わせる */
  border-radius: 0 10.2px 10.2px 0;
  top: -0.1px;
  left: 10.2px;
  transform-origin: 0px 10.2px;
  animation: loading 2s infinite ease;
}

@keyframes loading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* エラーメッセージ用のスタイル */
#payment-message {
  color: #dc3545; /* Bootstrapのdangerカラー */
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}

/* ============================================= */
/* ===== v6プラス申し込みモーダルのスタイル ===== */
/* ============================================= */

.modal-table.apply-table th {
  width: 30%; /* 項目名の幅を狭くする */
  background-color: #f7f9fc;
}

.modal-table.apply-table td {
  background-color: #fff;
}

.modal-table.apply-table .note {
  font-size: 0.8rem;
  color: #666;
  margin: 5px 0 0 0;
  font-weight: normal;
}

.modal-table.apply-table .note-red {
  font-size: 0.8rem;
  color: #dc3545;
  margin: 5px 0 0 0;
  font-weight: normal;
}

.form-actions {
  text-align: right; /* ボタンを右寄せにする */
  margin-top: 2rem;
}

.radio-group label {
  display: block;
  margin-bottom: 0.5rem;
}

/* ラジオボタンのレイアウト修正 */
.radio-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.radio-item input[type="radio"] {
  margin-right: 0.5rem;
  width: auto; /* ラジオボタンの幅を自動調整 */
}

.radio-item label {
  margin-bottom: 0; /* ラベル下の余分なマージンを削除 */
}

.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  display: block;
  margin-top: 5px;
}

.btn-disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* ================================================= */
/* ===== 会員登録完了ページ（追加情報）用のスタイル ===== */
/* ================================================= */

/* フォーム全体のコンテナ幅を広げる */
.signup-info-container {
  max-width: 600px;
}

/* フォームテーブルの共通スタイル */
.form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.form-table th,
.form-table td {
    padding: 12px 8px; /* パディングを調整してゆとりを持たせる */
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0; /* 行の間に薄い線を入れる */
}

.form-table tr:last-child th,
.form-table tr:last-child td {
    border-bottom: none; /* 最後の行の下線は消す */
}

.form-table th {
    width: 30%; /* 見出し列の幅を固定 */
    font-weight: normal; /* mypage-tableと合わせてnormalに */
    color: #333;
    padding-right: 20px; /* 見出しと入力欄の間のスペース */
}

/* input要素の幅を親要素に合わせる */
.form-table td input[type="text"],
.form-table td input[type="password"],
.form-table td input[type="tel"] {
    width: 100%;
    margin-bottom: 0; /* テーブルセル内でのマージンをリセット */
}


/* お客様情報入力フォームのラジオボタン */
.form-table td label {
    margin-right: 20px; /* ラジオボタン間のスペース */
    display: inline-flex;
    align-items: center;
    font-weight: normal;
}

.form-table td input[type="radio"] {
    width: auto; /* 幅を自動にする */
    margin-right: 8px; /* ボタンとテキストの間隔 */
}

/* =================================== */
/* ===== サポートページ用のスタイル ===== */
/* =================================== */

.support-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.support-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #333;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.support-card .material-icons {
  font-size: 48px;
  margin-bottom: 1rem;
  color: #007bff;
}

.support-card-title {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
}

/* h4の見出しスタイル */
#support-block h4 {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #007bff;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

/* 電話問い合わせボックスのスタイル */
.contact-info-box {
  background-color: #e7f3ff;
  border: 2px solid #007bff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.contact-info-box .contact-title {
  font-weight: bold;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 1rem; /* 下の要素との間隔を調整 */
}

.contact-info-box .contact-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem; /* 電話と番号の間のスペース */
  font-size: 1.8rem; /* 文字サイズを大きく */
  font-weight: bold;
}

.contact-info-box .contact-number {
  color: #007bff;
}

.contact-info-box .contact-support-name {
  font-size: 0.9rem;
  margin-top: 1rem; /* 上の要素との間隔を調整 */
}

/* =================================== */
/* ===== お問い合わせフォームのスタイル ===== */
/* =================================== */

#contact-form-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.radio-group-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.radio-group-container fieldset {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem;
}

.radio-group-container legend {
    font-weight: bold;
    padding: 0 0.5rem;
}

.radio-group-container label {
    display: block;
    margin-bottom: 0.5rem;
}

#contact-submit-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: bold;
}

#contact-form-message.success {
    color: #28a745;
    border: 1px solid #28a745;
    background-color: #e9f7ef;
    padding: 1rem;
    border-radius: 4px;
}

#contact-form-message.error {
    color: #dc3545;
    border: 1px solid #dc3545;
    background-color: #fdeeee;
    padding: 1rem;
    border-radius: 4px;
}
/* --- Loading Spinner --- */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#loading-text {
  color: #fff;
  font-size: 1.2rem;
}

#loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

#loading-spinner::before,
#loading-spinner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 0;
  background: conic-gradient(from 90deg at 50% 50%, #fff, #555, #fff);
  -webkit-mask: radial-gradient(
    farthest-side,
    #0000 calc(100% - 10px),
    #000 0
  );
  mask: radial-gradient(
    farthest-side,
    #0000 calc(100% - 10px),
    #000 0
  );
  animation: spin 1s linear infinite;
}

#loading-spinner::after {
  animation-delay: -0.5s;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ============================================= */
/* ===== モーダルボタンのスタイル調整        ===== */
/* ============================================= */

/* 確認モーダル等のアクションボタンを囲むコンテナ */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

/* アクションボタンのサイズを統一 */
.modal-actions button {
  height: 38px;
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================= */
/* ===== 汎用ボタンスタイル                ===== */
/* ============================================= */

/* 危険な操作を示すボタン (削除など) */
.btn-danger {
  background-color: #dc3545; /* Bootstrapのdangerカラー */
  color: white;
  border: none;
}
.btn-danger:hover {
  background-color: #c82333;
}

/* 第二の選択肢を示すボタン (キャンセルなど) */
.btn-secondary {
  background-color: #6c757d; /* Bootstrapのsecondaryカラー */
  color: white;
  border: none;
}
.btn-secondary:hover {
  background-color: #5a6268;
}

/* デフォルトの青色ボタンスタイルを上書きしないように調整 */
.modal-actions .btn-secondary {
  background-color: #6c757d;
  color: white;
}

/* =================================== */
/* ===== ログインページ用のスタイル ===== */
/* =================================== */
/* ページタイトルと説明文のコンテナ */
.login-intro-container {
  max-width: 400px; /* カードと幅を合わせる */
  margin: 2rem auto 0; /* 中央寄せし、上下の余白を調整 */
}

/* ログインカード内のh3のスタイルを、他のh3と統一する */
.login-container h3 {
  /* グローバルのh3スタイルを継承しつつ、マージンを調整 */
  text-align: left;
  border-left: 5px solid #007bff;
  padding-left: 10px;
  margin-top: 0; /* カードのpaddingがあるため、上マージンは0に */
  margin-bottom: 1.5rem; /* フォーム要素との間隔を確保 */
}

/* ログインボタンを中央寄せにする */
.login-button-container {
  text-align: center;
  margin-top: 1.5rem;
}

/* 各リンクを中央寄せにする */
.password-reset-container {
  text-align: center;
  margin-top: 1rem;
}

.password-reset-container a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
}

.password-reset-container a:hover {
  text-decoration: underline;
}
