/* ============================================================
   巫女まいこ診断 - form-style.css
   入力フォーム画面（index.html）専用スタイル
   common.css の :root 変数に依存
   ============================================================ */

/* ========== ヘッダー ========== */
.header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.header::after {
  content: '⛩';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ake);
  background: var(--bg);
  padding: 0 14px;
  font-size: 20px;
}
.header-label {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 5px;
  color: var(--ake);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}
.header-title {
  font-family: var(--font-jp-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text);
  margin-bottom: 14px;
}
.header-sub {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-family: var(--font-jp-serif);
  line-height: 1.9;
}

/* ========== フォームカード ========== */
.form-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  margin: 0 auto;
}

/* ========== フォームグループ ========== */
.form-group {
  margin-bottom: var(--space-lg);
}
.form-group:last-of-type {
  margin-bottom: var(--space-md);
}

/* ========== ラベル ========== */
.form-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}
.form-label > span:first-child {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--ake);
  font-weight: 500;
}
.form-label-jp {
  font-family: var(--font-jp-serif);
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 2px;
}
.required,
.optional {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-jp-sans);
}
.required {
  background: var(--ake);
  color: #fff;
}
.optional {
  background: var(--sakura);
  color: var(--ake-deep);
}

/* ========== 生年月日（下線スタイル） ========== */
.date-row {
  display: flex;
  gap: var(--space-sm);
  align-items: end;
}
.date-cell {
  position: relative;
  flex: 1;
}
.date-cell.year { flex: 1.6; }
.date-cell.month,
.date-cell.day  { flex: 1; }

.date-cell select {
  width: 100%;
  padding: 10px 24px 10px 4px;
  font-family: var(--font-jp-serif);
  font-size: 18px;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
  /* 朱色の下向き矢印（SVG） */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23c8434a' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.date-cell select:focus {
  border-bottom-color: var(--ake);
}
.date-cell select:hover {
  border-bottom-color: var(--ake-light);
}

/* セレクトの後ろに小さく単位ラベル表示（年/月/日） */
.date-cell::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-jp-serif);
  pointer-events: none;
}

/* ========== 性別ボタン ========== */
.gender-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.gender-btn {
  padding: 14px 8px;
  background: var(--bg2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-jp-serif);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.gender-btn:hover {
  background: var(--sakura-pale);
  border-color: var(--ake-light);
}
.gender-btn.active {
  background: var(--ake);
  color: #fff;
  border-color: var(--ake);
  box-shadow: var(--shadow-sm);
}
.gender-note {
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  font-family: var(--font-jp-sans);
}

/* ========== 送信ボタン ========== */
.submit-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-lg);
  padding: 18px var(--space-md);
  background: var(--ake);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-jp-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.submit-btn:hover:not(:disabled) {
  background: var(--ake-deep);
  box-shadow: var(--shadow-md);
}
.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.submit-btn:disabled {
  background: var(--line-strong);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}
.submit-btn .sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 4px;
  font-weight: 400;
  opacity: 0.85;
}

/* ========== 注釈 ========== */
.note {
  margin-top: var(--space-md);
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  font-family: var(--font-jp-sans);
}

/* ============================================================
   ローディングオーバーレイ（巫女のお告げ演出）
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(251, 248, 243, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s;
  overflow: hidden;
}
.loading-overlay.show {
  display: flex;
  opacity: 1;
}

/* ⛩ 鳥居（中央でゆっくり呼吸） */
.loading-torii {
  font-size: 72px;
  color: var(--ake);
  margin-bottom: var(--space-md);
  animation: torii-breath 2.4s ease-in-out infinite;
  text-shadow: 0 2px 12px rgba(200, 67, 74, 0.2);
}
@keyframes torii-breath {
  0%, 100% { transform: scale(1);   opacity: 0.95; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.loading-title {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--ake);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}
.loading-text {
  font-family: var(--font-jp-serif);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 2px;
  transition: opacity 0.4s;
  min-height: 1.7em;
}
.loading-text.fade {
  opacity: 0;
}
.loading-dots {
  display: inline-block;
  width: 1.5em;
  text-align: left;
  color: var(--ake);
}
.loading-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-md);
}
.loading-ornament .line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.loading-ornament .diamond {
  width: 6px;
  height: 6px;
  background: var(--ake);
  transform: rotate(45deg);
  opacity: 0.8;
}

/* ============================================================
   桜の花びらアニメーション（控えめ・6枚）
   個別の花びらを疑似要素で配置せず、複数の動く要素を
   .loading-petals 単独でカバーするため、box-shadow で複製
   ============================================================ */
.loading-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.loading-petals::before,
.loading-petals::after {
  content: '';
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  background: var(--kobai);
  border-radius: 12px 0 12px 0;
  opacity: 0.6;
  filter: blur(0.3px);
}

/* 花びら1〜3 (::before を3箇所に。box-shadowで分身を作る) */
.loading-petals::before {
  left: 15%;
  animation: petal-fall-1 7s linear infinite;
  box-shadow:
    25vw -10vh 0 var(--sakura),       /* 花びら2 */
    50vw -30vh 0 var(--ake-light);    /* 花びら3 */
}

/* 花びら4〜6 (::after を3箇所に) */
.loading-petals::after {
  left: 70%;
  animation: petal-fall-2 9s linear infinite;
  animation-delay: -2s;
  box-shadow:
    -55vw -20vh 0 var(--kobai),       /* 花びら5 */
    10vw -45vh 0 var(--sakura);       /* 花びら6 */
}

@keyframes petal-fall-1 {
  0%   { transform: translateY(0) rotate(0deg);    }
  100% { transform: translateY(120vh) rotate(360deg); }
}
@keyframes petal-fall-2 {
  0%   { transform: translateY(0) rotate(0deg);    }
  50%  { transform: translateY(60vh) rotate(180deg) translateX(20px); }
  100% { transform: translateY(120vh) rotate(360deg); }
}

/* ============================================================
   レスポンシブ（モバイル）
   ============================================================ */
@media (max-width: 480px) {
  .container {
    padding: var(--space-lg) var(--space-sm) var(--space-2xl);
  }
  .header-title {
    font-size: 24px;
    letter-spacing: 3px;
  }
  .header-sub {
    font-size: 13px;
  }
  .form-card {
    padding: var(--space-md) var(--space-sm);
  }
  .date-cell select {
    font-size: 16px;
  }
  /* 性別ボタンは 4列 → 2x2 */
  .gender-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .submit-btn {
    font-size: 16px;
    letter-spacing: 3px;
    padding: 16px var(--space-sm);
  }
  .loading-torii {
    font-size: 60px;
  }
  .loading-text {
    font-size: 14px;
  }
}
