@import url("https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@700&family=Noto+Sans+JP:wght@400;600&display=swap");

/* =========================================
   Hearing Form – Bright Luxury UI (Cool Gradient)
   ・白ベースに、モダンでクールなグラデーションをアクセント
   ・優雅なタイポグラフィと十分な余白
   ========================================= */

/* カラーパレット */
:root {
  --hf-bg: #f7f8fc;
  --hf-surface: #ffffff;
  --hf-text: #2c3e50;
  --hf-muted: #6c757d;
  --hf-border: #e2e8f0;
  --hf-accent-primary: #6a11cb; /* Ultraviolet */
  --hf-accent-secondary: #2575fc; /* Electric Blue */
  --hf-accent-ink: #ffffff;
  --hf-ring: rgba(106, 17, 203, 0.25);
  --hf-ok-bg: rgba(106, 17, 203, 0.1);
  --hf-ng-bg: #fff1f2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  background-color: var(--hf-bg);
}

/* ベース */
.hf-wrap {
  --radius: 14px;
  --radius-lg: 18px;
  --pad: 16px;
  --card-pad: 24px;
  max-width: 880px;
  margin: 0 auto;
  color: var(--hf-text);
  font-family: "Noto Sans JP", sans-serif;
}

.hf-title {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.5rem);
  font-weight: 700;
  margin: 20px 0 30px;
  letter-spacing: 0.04em;
  text-align: center;
  /* Gradient Text */
  color: var(--hf-accent-primary); /* Fallback */
  background: linear-gradient(45deg, var(--hf-accent-primary), var(--hf-accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

/* セクションカード */
.hf-section {
  position: relative;
  border: 1px solid var(--hf-border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  margin: 40px 0;
  background: var(--hf-surface);
  box-shadow: 0 10px 25px rgba(44, 62, 80, 0.08);
}

.hf-section legend {
  font-family: "Shippori Mincho", serif;
  font-weight: 700;
  font-size: 1.4rem;
  padding: 0 8px;
  color: var(--hf-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hf-sec-desc {
  margin: -2px 0 20px;
  color: var(--hf-muted);
  font-size: 0.95rem;
}

/* レイアウトグリッド */
.hf-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
}
.hf-field {
  grid-column: span 6;
}

/* フィールド */
.hf-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hf-label {
  font-weight: 600;
  color: var(--hf-text);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hf-req {
  color: #e74c3c;
  font-weight: 700;
}

/* 共通インプット */
.hf-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hf-border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--hf-surface);
  color: var(--hf-text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.hf-input:hover {
  border-color: color-mix(in srgb, var(--hf-border) 50%, var(--hf-accent-primary));
}

.hf-input:focus,
.hf-input:focus-visible {
  outline: none;
  border-color: var(--hf-accent-primary);
  box-shadow: 0 0 0 3px var(--hf-ring);
}

/* テキストエリアは少し広め */
textarea.hf-input {
  min-height: 140px;
  resize: vertical;
}

/* 選択UI（ラジオ/チェック） */
.hf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hf-opt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--hf-border);
  border-radius: 8px;
  background: var(--hf-surface);
  cursor: pointer;
  font-size: 0.95rem;
  transition:
    transform 0.1s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
  user-select: none;
}
.hf-opt:hover {
  border-color: var(--hf-accent-primary);
  background-color: var(--hf-ok-bg);
}
.hf-opt:active {
  transform: translateY(1px);
}
.hf-opt input {
  accent-color: var(--hf-accent-primary);
}

/* セレクト */
select.hf-input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--hf-muted) 50%),
    linear-gradient(135deg, var(--hf-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50%),
    calc(100% - 14px) calc(50%);
  background-size:
    8px 8px,
    8px 8px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

/* file入力を少し整える */
input[type="file"].hf-input {
  padding: 10px;
}
input[type="file"].hf-input::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 10px 16px;
  border: 1px solid var(--hf-border);
  border-radius: 8px;
  background: #f7f8fc;
  color: var(--hf-text);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}
input[type="file"].hf-input::-webkit-file-upload-button:hover {
  border-color: var(--hf-accent-primary);
  background-color: #fff;
}

/* ヘルプ・補足 */
.hf-help {
  color: var(--hf-muted);
  margin-top: -4px;
  font-size: 0.9rem;
}

/* アラート */
.hf-ok {
  display: flex;
  justify-content: center;
  background: var(--hf-ok-bg);
  border: 1px solid var(--hf-accent-primary);
  padding: 14px;
  border-radius: 12px;
  margin-top: 12px;
  color: color-mix(in srgb, var(--hf-accent-primary) 80%, #000);
}
.hf-ng {
  background: var(--hf-ng-bg);
  border: 1px solid #fecaca;
  padding: 14px;
  border-radius: 12px;
  margin-top: 12px;
  color: #991b1b;
}
.hf-error {
  background: #fff1f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 14px;
  border-radius: 12px;
}

/* ボタン行 */
.hf-submit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.hf-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(145deg, var(--hf-accent-primary), var(--hf-accent-secondary));
  color: var(--hf-accent-ink);
  padding: 16px 32px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  transition:
    transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 20px rgba(106, 17, 203, 0.35);
}
.hf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(106, 17, 203, 0.45);
}
.hf-btn:active {
  transform: translateY(0px);
  filter: brightness(1.05);
}
.hf-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  background: #bdc3c7;
}

.hf-note {
  color: var(--hf-muted);
  font-size: 13px;
  text-align: center;
  width: 100%;
}

/* 送信結果 */
.hf-result {
  margin-top: 20px;
}

/* 入力の状態（任意で付与可能: .is-error / .is-valid） */
.hf-field.is-error .hf-input {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}
.hf-field.is-valid .hf-input {
  border-color: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

/* フォーカスリングの視認性（キーボード操作時） */
.hf-input:focus-visible,
.hf-opt input:focus-visible {
  outline: 2px solid var(--hf-accent-primary);
  outline-offset: 2px;
}

/* 印刷最適化（社内共有用） */
@media print {
  body {
    background-color: #fff;
  }
  .hf-wrap {
    max-width: 100%;
  }
  .hf-section {
    box-shadow: none;
    background: #fff;
    border: 1px solid #ccc;
  }
  .hf-btn,
  .hf-note {
    display: none !important;
  }
}

/* 既存トークン（テーマに合わせて上書きしたい場合） */
.hf-wrap {
  background: transparent;
}
.hf-section {
  background: var(--hf-surface);
}

/* =========================================
   レスポンシブ対応 (SP)
   ========================================= */
@media (max-width: 768px) {
  .hf-wrap {
    --card-pad: 20px;
    padding: 0 10px;
  }

  .hf-title {
    font-size: clamp(1.5rem, 1.3rem + 1.5vw, 1.8rem);
    margin: 15px 0 20px;
  }

  .hf-section {
    margin: 25px 0;
    padding: var(--card-pad);
  }

  .hf-section legend {
    font-size: 1.2rem;
  }

  .hf-btn {
    padding: 14px 24px;
    font-size: 1rem;
    width: 100%; /* ボタンを全幅に */
  }

  .hf-submit-row {
    gap: 10px;
  }

  .hf-note {
    font-size: 12px;
  }
}
