/* =========================================
   共通スタイル: 花柄・暖色系デザイン
   ========================================= */

/* --- 全体のリセットとベース --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-image: url(../img/gradient-bg.webp);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100vh;
}

/* ================================
   Header
================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--header-h);
  background: rgba(15, 6, 9, 0.85);
  opacity: 0.75;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 20px;
}

.header-logo {
  height: 28px;
  width: auto;
  opacity: 1;
}

header h1 {
  font-size: 1rem;
  color: var(--color-text);
  margin-left: 24px;
  opacity: 0.7;
}
header h1 a {
  display: flex;
  align-items: center;
  width: 150px;
  height: auto;
  color: #e8ddd5;
}

header h1 a img {
  margin-right: 10px;
}

/* --- メインコンテナ --- */
.container {
  background: rgba(255, 255, 255, 0.95); /* 少し透過させて背景になじませる */
  padding: 40px;
  margin: 40px auto;
  border-radius: 15px;
  /* 柔らかいゴールド系の影 */
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.1);
  width: 80%;
  max-width: 400px;
  font-family:
    "Times New Roman", "YuMincho", "Hiragino Mincho ProN", "Yu Mincho",
    "MS PMincho", serif;
  color: #5d4037; /* 濃いブラウンで柔らかく */
  border: 1px solid #f3e5f5; /* 薄いパープル/ピンクの枠線 */
  position: center;
}

/* --- 見出し --- */
h2 {
  text-align: center;
  color: #8e24aa; /* 深いパープル */
  margin-bottom: 30px;
  font-size: 1.55em;
  font-weight: normal;
  position: relative;
  padding-bottom: 15px;
}
見出しの下の装飾線（花びら風） h2::after {
  content: none;
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6em;
  color: #f48fb1;
}

/* --- フォーム要素 --- */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

div.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.9em;
  color: #8d6e63;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e1bee7;
  border-radius: 8px;
  background-color: #fff;
  font-size: 1em;
  color: #5d4037;
  transition: all 0.3s ease;
}

/* フォーカス時にコーラルピンクの光彩 */
input:focus {
  outline: none;
  border-color: #f48fb1;
  box-shadow: 0 0 8px rgba(244, 143, 177, 0.3);
}

/* --- ボタン --- */
button {
  padding: 12px;
  background: linear-gradient(
    45deg,
    #ff8a65,
    #f48fb1
  ); /* コーラル〜ピンクのグラデーション */
  color: white;
  border: none;
  border-radius: 25px; /* 丸みを強くして柔らかく */
  font-size: 1.1em;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(244, 143, 177, 0.3);
  font-family: inherit;
  font-weight: bold;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(244, 143, 177, 0.4);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

/* ★無効化ボタン（パスワード不一致時など） */
button:disabled {
  background: #d7ccc8; /* 暖かみのあるグレー */
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ★追記: 会員番号コピー専用ボタン（共通ボタンのスタイルを上書き） */
.copy-btn {
  background: #fff;
  color: #ab47bc;
  border: 1px solid #ab47bc;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  width: auto; /* 全幅ではなく自動幅に */
  box-shadow: none;
}

.copy-btn:hover {
  background: #f3e5f5;
  border-color: #f48fb1;
  color: #f48fb1;
  transform: none; /* コピーボタンは跳ねさせない */
}

/* --- リンク --- */
a {
  color: #ab47bc;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9em;
}

a:hover {
  color: #f48fb1;
  text-decoration: underline;
}

/* --- メッセージ表示（エラー/成功） --- */
p.error,
p.success,
.response-data {
  text-align: center;
  font-size: 0.9em;
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 8px;
}

p.error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

p.success {
  background-color: #f1f8e9;
  color: #33691e;
  border: 1px solid #dcedc8;
}

/* ★追記: 完了画面の会員番号カード */
.member-card {
  background: #fff;
  border: 2px dashed #f48fb1;
  border-radius: 12px;
  padding: 20px 10px;
  margin: 15px 0;
  text-align: center;
}

.member-number {
  font-size: 0.8em;
  color: #8e24aa;
  font-weight: bold;
  display: block;
  position: center;
  margin: 5px 0;
  letter-spacing: 1px;
}

/* =========================================
    新規登録画面 追加要素（パスワード関連）
   ========================================= */

/* パスワード入力欄の親要素（「表示」ボタンを中に置くため） */
.pass-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* 「表示」切り替えボタン */
.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #ab47bc;
  cursor: pointer;
  font-size: 0.75em;
  font-weight: bold;
  padding: 5px;
  z-index: 5;
  box-shadow: none; /* 共通ボタンの影を消す */
  width: auto; /* 共通ボタンの横幅を打ち消す */
  height: auto;
}

.toggle-pass:hover {
  color: #f48fb1;
  background: none;
  transform: none;
}

/* パスワード不一致エラーテキスト */
#passError {
  color: #e57373;
  font-size: 0.8em;
  margin-top: -12px;
  margin-bottom: 10px;
  padding-left: 5px;
  text-align: left;
  display: none; /* 初期は非表示 */
}

/* /* =========================================
   マイページ (`mypage.php`) 専用スタイル
   ========================================= */

/* データ表示セクション */
.response-data {
  background-color: #fffaf0; /* アイボリー */
  padding: 20px;
  margin-top: 25px;
  border-radius: 10px;
  border: 1px solid #fff3e0;
  position: relative;
  text-align: left; /* マイページ内では左寄せに */
}

/* セクションの見出し（users, visitsなど） */
.response-data strong {
  color: #a1887f;
  display: block;
  margin-bottom: 15px;
  font-size: 1em;
  border-left: 3px solid #f48fb1; /* ピンクのアクセント */
  padding-left: 10px;
}

/* 登録/ログイン下部のリンクエリア */
.form-footer {
  text-align: center;
  margin-top: 25px;
  font-size: 0.9em;
  color: #8d6e63;
}

/* スキャナーの枠を適切に制限 */
.scanner-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px; /* 枠の最大幅を小さく設定 */
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  border: 3px solid #f48fb1; /* ピンクの枠線で視認性向上 */
}

#canvas {
  width: 100%; /* 親要素(280px)に合わせる */
  height: auto;
  display: block;
}
