/* ============================================================
   INASE Charity Fight - エントリーフォーム
   公式HP（赤 × 黒 × 白）のデザイン言語に準拠。モバイルファースト。
   ============================================================ */

:root{
  color-scheme: dark;

  --red:         #DC0A0A;
  --red-light:   #FF2020;
  --red-text:    #FF4D4D;  /* 黒背景上の小さな赤文字用（コントラスト確保） */
  --black:       #0A0A0A;
  --black-light: #1A1A1A;
  --black-mid:   #222222;
  --gray:        #888888;
  --gray-light:  #CCCCCC;
  --white:       #F5F5F5;
  --error:       #F87171;

  --line:        rgba(220, 10, 10, .2);
  --line-strong: rgba(220, 10, 10, .45);

  --font-ja: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  --transition: .2s ease;
  --gutter: 16px;
}
@media (min-width: 640px){
  :root{ --gutter: 24px; }
}

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-ja);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
p{ margin: 0; }
[hidden]{ display: none !important; }

.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* キーボード操作時のフォーカス表示 */
:focus-visible{
  outline: 2px solid var(--red-text);
  outline-offset: 3px;
}
[tabindex="-1"]:focus{ outline: none; }

.container{
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ----------------------------------------------------------
   ヘッダー / ページヒーロー / フッター
   ---------------------------------------------------------- */
.site-header{
  background: rgba(10, 10, 10, .97);
  border-bottom: 1px solid rgba(220, 10, 10, .25);
}
.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo{
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon{
  width: 34px; height: 34px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 17px;
  color: var(--white);
  flex-shrink: 0;
}
.logo-text strong{
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
}
.logo-text span{
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--red-text);
  font-weight: 700;
  text-transform: uppercase;
}
.site-header__label{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gray);
}

.page-hero{
  position: relative;
  background: var(--black-light);
  padding: 36px 0 32px;
  overflow: hidden;
}
.page-hero::before{
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 80% at 0% 50%, rgba(220, 10, 10, .1) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero::after{
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(220, 10, 10, .4), transparent);
}
.page-hero__inner{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-hero__title{
  margin: 0 0 10px;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 900;
  line-height: 1.2;
}
.page-hero__sub{
  color: var(--gray-light);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}
.page-hero__logo{
  width: 72px; height: 72px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(220, 10, 10, .35);
}

.eyebrow{
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--red-text);
}

.site-footer{
  border-top: 1px solid rgba(220, 10, 10, .2);
  text-align: center;
  padding: 0 0 40px;
}
.site-footer__accent{
  height: 2px;
  margin-bottom: 24px;
  background: linear-gradient(to right, transparent, var(--red), transparent);
}
.site-footer small{
  font-size: 12px;
  color: var(--gray);
}

/* ----------------------------------------------------------
   メイン / ステップ表示 / 画面見出し
   ---------------------------------------------------------- */
.main{
  padding-top: 28px;
  padding-bottom: 64px;
}

.stepper{
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-strong);
}
.stepper__item{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray);
  background: var(--black);
}
.stepper__item + .stepper__item{ border-left: 1px solid var(--line-strong); }
.stepper__num{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}
.stepper__item.is-done{ color: var(--gray-light); }
.stepper__item.is-done .stepper__num{ color: var(--red-text); }
.stepper__item.is-current{
  background: var(--red);
  color: #fff;
}

.view-head{ margin-bottom: 28px; }
.view-head__title{
  margin: 0 0 10px;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 900;
  line-height: 1.35;
}
.view-head__desc{
  color: var(--gray-light);
  font-size: 14px;
}

/* ----------------------------------------------------------
   エラーまとめ / アラート
   ---------------------------------------------------------- */
.error-summary{
  margin-bottom: 28px;
  padding: 16px 18px;
  background: rgba(220, 10, 10, .1);
  border: 1px solid rgba(248, 113, 113, .5);
  border-left: 3px solid var(--error);
}
.error-summary__title{
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}
.error-summary ul{
  margin: 0;
  padding-left: 1.2em;
}
.error-summary li{ margin: 4px 0; }
.error-summary a{
  color: var(--error);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alert{
  margin-top: 24px;
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid;
}
.alert--error{
  background: rgba(220, 10, 10, .1);
  border-color: rgba(248, 113, 113, .5);
  color: var(--error);
}

/* ----------------------------------------------------------
   セクション見出し（英語小見出し + 日本語見出し + 赤ライン）
   ---------------------------------------------------------- */
.form-section{ margin-bottom: 44px; }

.section-head{ margin-bottom: 22px; }
.section-head__en{
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--red-text);
}
.section-head__ja{
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.4;
}
.section-head__line{
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-head__line::before{
  content: '';
  width: 48px; height: 2px;
  background: var(--red);
}
.section-head__line::after{
  content: '';
  width: 16px; height: 2px;
  background: rgba(220, 10, 10, .35);
}

/* ----------------------------------------------------------
   フィールド
   ---------------------------------------------------------- */
.row{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 16px;
}
.row--pair{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px){
  .row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field{
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}
fieldset.field > legend{ padding: 0; }

.field__label{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-light);
}
.field__help{
  margin-top: 8px;
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
}
.field__help--top{ margin: 0 0 12px; }
.field__help strong{ color: var(--gray-light); }

.tag{
  display: inline-block;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.8;
  border: 1px solid;
  vertical-align: middle;
}
.tag--req{ color: #fff; background: var(--red); border-color: var(--red); }
.tag--opt{ color: var(--gray); border-color: #444; }

/* テキスト系入力 */
.field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field textarea{
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;          /* iOS の自動ズーム防止のため 16px 以上を維持 */
  line-height: 1.5;
  color: var(--white);
  background: var(--black-light);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:hover:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field textarea:hover{
  border-color: rgba(220, 10, 10, .7);
}
.field input:focus:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field textarea:focus{
  border-color: var(--red-text);
  box-shadow: 0 0 0 1px var(--red-text);
}
.field input::placeholder,
.field textarea::placeholder{ color: #6E6E6E; }
.field textarea{
  min-height: 140px;
  resize: vertical;
}
.field input[type="date"]{ min-width: 0; }
.field input[type="date"]::-webkit-date-and-time-value{ text-align: left; }
@media (min-width: 640px){
  .field--narrow{ max-width: calc(50% - 8px); }
}

/* 単位付き入力（年 / cm / kg） */
.input-unit{
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-unit input{ flex: 1 1 auto; min-width: 0; }
.input-unit--short{ max-width: 200px; }
.input-unit__suffix,
.record__unit{
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-light);
}

/* 戦歴（戦・勝・敗） */
.record{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.record__item{
  display: flex;
  align-items: center;
  gap: 6px;
}
.record__item input{ flex: 1 1 auto; min-width: 0; text-align: right; }
@media (min-width: 640px){
  .record{ max-width: 420px; }
}

/* エラー状態 */
.field.has-error input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.field.has-error textarea{
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}
.field__error{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--error);
}
.field__error::before{
  content: '!';
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 900;
  color: var(--black);
  background: var(--error);
}

/* ----------------------------------------------------------
   希望試合体重（ラジオをタイル化）
   ---------------------------------------------------------- */
.weight-grid{
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 420px){
  .weight-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.weight-grid input[type="radio"]{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.weight-grid label{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-light);
  background: var(--black-light);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.weight-grid label:hover{ border-color: var(--red); color: var(--white); }
.weight-grid input[type="radio"]:checked + label{
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.weight-grid input[type="radio"]:focus-visible + label{
  outline: 2px solid var(--red-text);
  outline-offset: 2px;
}
.field.has-error .weight-grid label{ border-color: rgba(248, 113, 113, .7); }

/* ----------------------------------------------------------
   選手写真
   ---------------------------------------------------------- */
.photo{ position: relative; }
.photo__input{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.photo__drop{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 24px 16px;
  text-align: center;
  background: var(--black-light);
  border: 1px dashed var(--line-strong);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.photo__drop:hover{ border-color: var(--red); background: rgba(220, 10, 10, .05); }
.photo__icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-bottom: 4px;
  font-size: 22px;
  color: var(--red-text);
  border: 1px solid var(--red);
}
.photo__text{ font-size: 15px; font-weight: 700; }
.photo__note{ font-size: 12px; color: var(--gray); }

.photo__preview{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--black-light);
  border: 1px solid var(--line-strong);
}
.photo__thumb,
.photo__fallback{
  width: 96px; height: 96px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--black);
}
.photo__fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-size: 11px;
  color: var(--gray);
  text-align: center;
  border: 1px solid #333;
}
.photo__meta{ min-width: 0; }
.photo__name{
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.photo__size{
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--gray);
}
.photo__input:focus-visible + .photo__drop,
.photo__input:focus-visible ~ .photo__preview{
  outline: 2px solid var(--red-text);
  outline-offset: 3px;
}
.field.has-error .photo__drop,
.field.has-error .photo__preview{ border-color: var(--error); }

/* ----------------------------------------------------------
   ルール・大会趣旨 / 同意チェック
   ---------------------------------------------------------- */
.info-card{
  margin-bottom: 12px;
  padding: 18px;
  background: var(--black-light);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
}
.info-card__title{
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--red-text);
}
.info-card p{
  font-size: 14px;
  line-height: 1.85;
  color: var(--gray-light);
}
.info-card strong{ color: var(--white); }
.info-card__btn{ margin-top: 14px; }

.check{
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  background: var(--black);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.check:hover{ border-color: var(--red); }
.check input[type="checkbox"]{
  width: 22px; height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}
.check__text{ flex: 1 1 auto; }
.check:has(input:checked){
  border-color: var(--red);
  background: rgba(220, 10, 10, .1);
}
.field.has-error .check{ border-color: var(--error); }

/* ----------------------------------------------------------
   ボタン
   ---------------------------------------------------------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn--primary{
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn--primary:hover{ background: var(--red-light); border-color: var(--red-light); }
.btn--outline{
  background: transparent;
  border-color: var(--gray-light);
  color: var(--white);
}
.btn--outline:hover{ border-color: var(--red-text); color: var(--red-text); }
.btn--outline-red{
  background: transparent;
  border-color: var(--red);
  color: var(--red-text);
}
.btn--outline-red:hover{ background: var(--red); color: #fff; }
.btn--block{ width: 100%; }
.btn--sm{
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}
.btn:disabled,
.btn[aria-disabled="true"]{
  opacity: .55;
  cursor: not-allowed;
}

.form-actions{
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.form-actions__note{
  margin-top: 12px;
  font-size: 12px;
  color: var(--gray);
  text-align: center;
}
@media (min-width: 640px){
  .form-actions .btn{ display: flex; max-width: 420px; margin: 0 auto; }
}

/* ----------------------------------------------------------
   確認画面
   ---------------------------------------------------------- */
.confirm-group{ margin-bottom: 32px; }
.confirm-group .section-head{ margin-bottom: 8px; }
.confirm-group .section-head__ja{ font-size: 17px; margin-bottom: 0; }

.confirm-list{ margin: 0; }
.confirm-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.confirm-row dt{
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
}
.confirm-row dd{
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.confirm-row dd.is-empty{ color: var(--gray); font-weight: 400; }
.confirm-note{
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray);
  white-space: normal;
}
.confirm-photo{
  width: 160px; height: 160px;
  margin-bottom: 8px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--black-light);
}
@media (min-width: 640px){
  .confirm-row{
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
  }
}

.confirm-actions{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 36px;
}
@media (min-width: 640px){
  .confirm-actions{
    flex-direction: row-reverse;
    justify-content: center;
  }
  .confirm-actions .btn{ flex: 1 1 0; max-width: 320px; }
}
.send-status{
  margin-top: 14px;
  min-height: 1.6em;
  font-size: 13px;
  color: var(--gray-light);
  text-align: center;
}

/* ----------------------------------------------------------
   完了画面
   ---------------------------------------------------------- */
.complete{
  position: relative;
  padding: 48px 20px;
  text-align: center;
  background: var(--black-light);
  border: 1px solid rgba(220, 10, 10, .35);
}
.complete::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--red), transparent);
}
.complete__mark{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  font-size: 30px;
  font-weight: 900;
  color: var(--red-text);
  border: 2px solid var(--red);
}
.complete__title{
  margin: 0 0 16px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 900;
  line-height: 1.4;
}
.complete__text{
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--gray-light);
}

/* ----------------------------------------------------------
   タブレット以上
   ---------------------------------------------------------- */
@media (min-width: 640px){
  .site-header__inner{ height: 64px; }
  .page-hero{ padding: 60px 0 48px; }
  .page-hero__logo{ width: 104px; height: 104px; }
  .main{ padding-top: 40px; padding-bottom: 80px; }
  .stepper{ margin-bottom: 40px; }
  .section-head__ja{ font-size: 22px; }
  .complete{ padding: 64px 40px; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}
