/*
 * 登録・情報修正フォーム（残タスク 1-2・T-152。モック「フリースクール情報登録」が正）。
 *
 * **Tailwind の任意値クラス（`lg:min-h-[216px]` など）を使わない**（T-111）。
 * ビルド済みCSSに含まれず、黙って効かない。ここは素のCSSで書く。
 *
 * ## 施設ページと同じ寸法にそろえてある（T-152）
 *
 * `facility-page.css` を実機で測った値（2026-09-24・Playwright）。
 * **目分量で合わせない**（Y-13・Y-19）。
 *
 * | | PC（1024px〜） | スマホ |
 * |---|---|---|
 * | 白い箱の幅 | 1100px（`.fp-box`） | 画面いっぱい |
 * | 箱の左右の余白 | 80px | 20px |
 * | 角 | 16px | 0 |
 * | 節の見出し | 26px / 700（`.fp-h2`） | 20px |
 * | 項目名・値 | 16px（`.fp-row__label`） | 14px |
 * | 項目名の幅 | 180px ＋ 右20px | 105px |
 *
 * **`.ff-wrap` に左右の余白を付けない。** 付けると白い箱が 1100px より細くなり、
 * 施設ページと並べたときに端がずれる（これが最初の実装の間違い）。
 *
 * 接頭辞は `ff-`（facility form）。
 */

/* ───────── 器（施設ページの .fp-wrap と同じ） ───────── */
.ff-wrap { max-width: 1100px; margin: 0 auto; padding: 0 0 48px; color: #222; }

/* ───────── 白い箱（.fp-box と同じ寸法） ───────── */
.ff-intro,
.ff-steps,
.ff-section,
.ff-blocked {
    background: #fff;
    padding: 20px;
    margin: 0 0 16px;
}

.ff-intro h1 { color: #2F8FFF; font-size: 20px; font-weight: 700; margin: 0 0 16px; line-height: 1.65; }
.ff-intro p  { font-size: 14px; line-height: 1.9; color: #333; margin: 0; }

/* ───────── 段（01.情報入力 → 02.登録完了） ───────── */
.ff-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
}
.ff-steps .now  { color: #2F8FFF; }
.ff-steps .next { color: #333; }
.ff-steps .sep  { color: #BBB; font-weight: 400; }

/*
 * 白い箱の**外**にある要素（節の見出し・パンくず・末尾の一文）。
 *
 * 器（`.ff-wrap`）に左右の余白を持たせると白い箱が細くなるので持たせていない（T-152）。
 * その代わり、**箱の外に出るものはここで自分の分だけ寄せる。**
 * 寄せ幅は箱の内側の余白と同じ（スマホ20px）なので、箱の中の文字と縦にそろう。
 */
.ff-crumbs,
.ff-section-head,
.ff-foot { padding-left: 20px; padding-right: 20px; }

.ff-crumbs { font-size: 13px; line-height: 1.8; color: #666; padding-top: 12px; padding-bottom: 4px; }
.ff-crumbs a { color: #666; }

/* ───────── 節の見出し（.fp-h2 と同じ） ───────── */
.ff-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 32px 0 20px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.65;
}
.ff-section-head::before {
    content: '';
    width: 16px;
    height: 16px;
    background: #2F8FFF;
    border-radius: 3px;
    display: block;
    flex: 0 0 16px;
}
.ff-section .ff-lead { color: #2F8FFF; font-size: 14px; line-height: 1.9; margin: 0 0 24px; }

/* ───────── 1行（.fp-row と同じ寸法） ───────── */
.ff-row { display: block; padding: 10px 0; border-bottom: 1px solid #EFEFEF; }
.ff-row:last-child { border-bottom: 0; }

.ff-label { font-size: 14px; font-weight: 700; line-height: 1.65; margin-bottom: 8px; }
.ff-label .ff-note { display: block; font-size: 12px; font-weight: 400; color: #898989; margin-top: 4px; line-height: 1.6; }
.ff-badge {
    display: inline-block;
    background: #FF4F8B;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
    padding: 2px 7px;
    margin-left: 8px;
    vertical-align: 1px;
    line-height: 1.4;
}
.ff-field { min-width: 0; }

/* ───────── 入力部品 ───────── */
.ff-input, .ff-select, .ff-textarea {
    border: 1px solid #DDD;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.65;
    background: #fff;
    color: #222;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}
.ff-select { max-width: 240px; appearance: auto; }
.ff-textarea { min-height: 110px; resize: vertical; }
.ff-input:focus, .ff-select:focus, .ff-textarea:focus { outline: 2px solid #9CC8FF; outline-offset: -1px; }
.ff-unit { font-size: 14px; color: #555; }

.ff-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ff-inline .ff-input, .ff-inline .ff-select { width: auto; }

/*
 * 常勤・非常勤。**かたまりごとに折り返す。**
 * スマホは1行ずつ（「非常勤」とその入力欄が離れない）。
 */
.ff-staff { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.ff-staff__item { display: flex; align-items: center; gap: 10px; }
.ff-staff__item .ff-input, .ff-staff__item .ff-select { width: auto; max-width: 140px; }
@media (max-width: 767px) {
    .ff-staff { flex-direction: column; align-items: flex-start; }
    .ff-staff__item { width: 100%; }
    .ff-staff__item .ff-unit:first-child { flex: 0 0 56px; }
    .ff-staff__item .ff-input, .ff-staff__item .ff-select { flex: 1 1 auto; max-width: none; }
}

.ff-btn-small {
    background: #2F8FFF;
    color: #fff;
    border: 0;
    border-radius: 5px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.ff-btn-small:hover { background: #1B7BEE; }

/* ───────── 選択肢（チェック・ラジオ） ───────── */
.ff-choices { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.ff-choices.cols3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.ff-choice { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.65; cursor: pointer; }
.ff-choice input { width: 18px; height: 18px; accent-color: #2F8FFF; flex: 0 0 18px; }

/* 学べること：43項目を見出しでまとめる（T-145） */
.ff-topic-group { margin-bottom: 20px; }
.ff-topic-group:last-child { margin-bottom: 0; }
.ff-topic-head {
    font-size: 15px;
    font-weight: 700;
    color: #2F8FFF;
    border-bottom: 1px solid #E7F1FF;
    padding-bottom: 6px;
    margin-bottom: 12px;
    line-height: 1.65;
}

/* ───────── 営業時間 ───────── */
.ff-hours-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ff-day {
    border: 1px solid #DDD;
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
    padding: 8px 0;
    width: 46px;
    text-align: center;
    flex: 0 0 46px;
    line-height: 1.4;
}
.ff-day.on { background: #2F8FFF; border-color: #2F8FFF; color: #fff; font-weight: 700; }
.ff-time {
    border: 1px solid #DDD; border-radius: 6px; padding: 10px 12px;
    font-size: 14px; width: 200px; font-family: inherit; box-sizing: border-box;
}

/* ───────── 設備（◯／✗／不明 の3状態） ───────── */
.ff-eq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.ff-eq { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.ff-eq-name { font-size: 14px; line-height: 1.65; flex: 1 1 auto; }
.ff-tri { display: flex; border: 1px solid #DDD; border-radius: 14px; overflow: hidden; flex: 0 0 auto; }
.ff-tri button {
    border: 0;
    background: #F4F4F4;
    color: #999;
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
}
.ff-tri button.on-yes     { background: #2F8FFF; color: #fff; font-weight: 700; }
.ff-tri button.on-no      { background: #888;    color: #fff; font-weight: 700; }
.ff-tri button.on-unknown { background: #E4E4E4; color: #555; font-weight: 700; }

/* ───────── 候補（郵便番号・重複・法人） ───────── */
.ff-hint { background: #F3F8FF; border-radius: 8px; padding: 14px 16px; margin-top: 10px; font-size: 14px; line-height: 1.8; }
.ff-hint p { margin: 0 0 8px; }
.ff-hint p:last-child { margin-bottom: 0; }
.ff-hint a, .ff-hint button.link {
    color: #2F8FFF;
    background: none;
    border: 0;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.ff-town-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.ff-error { color: #D5334F; font-size: 13px; line-height: 1.7; margin-top: 6px; }

/* ───────── 送信 ───────── */
.ff-submit { text-align: center; margin: 32px 0 16px; }
.ff-btn {
    background: #2F8FFF;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 14px 44px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.ff-btn:hover { background: #1B7BEE; }
.ff-btn.dark { background: #333; }
.ff-btn.dark:hover { background: #111; }
.ff-foot { text-align: center; font-size: 14px; color: #666; }
/* T-406。保存（画像登録に進む）を画面の下に追随させる */
.ff-submit--float {
    position: fixed; left: 0; right: 0; bottom: 16px; z-index: 900; margin: 0;
    display: flex; justify-content: center; padding: 0 20px; pointer-events: none;
}
.ff-btn--float {
    pointer-events: auto; width: 100%; max-width: 400px; position: relative;
    padding: 16px 44px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.ff-btn__chev { position: absolute; right: 22px; top: 50%; transform: translateY(-52%); font-size: 26px; line-height: 1; }
.ff-btn--float[disabled] { opacity: .6; }
.ff-float-spacer { height: 96px; }

/* ───────── 止まったときの画面（R-13〜R-16）・登録完了 ───────── */
.ff-blocked h2 { color: #2F8FFF; font-size: 20px; font-weight: 700; margin: 0 0 20px; line-height: 1.5; }
.ff-blocked p { font-size: 14px; line-height: 2; margin: 0 0 16px; }
.ff-blocked .ff-link { color: #2F8FFF; font-size: 14px; text-decoration: none; }
.ff-blocked .ff-link:hover { text-decoration: underline; }
.ff-blocked .ff-actions { text-align: center; margin-top: 40px; }
/* モックは2つのボタンが同じ幅。文字数で幅が変わらないようにする */
.ff-blocked .ff-actions .ff-btn { min-width: 240px; text-align: center; }
.ff-blocked .ff-actions .note { font-size: 14px; color: #333; margin-top: 12px; }

/* ───────── PC（施設ページと同じ 1024px から） ───────── */
@media (min-width: 1024px) {
    .ff-wrap { margin-top: 20px; padding-bottom: 60px; }

    /* PC は器が中央に寄っていて端に付かないので、寄せは要らない */
    .ff-crumbs, .ff-section-head, .ff-foot { padding-left: 0; padding-right: 0; }
    .ff-crumbs { font-size: 14px; padding-top: 16px; }

    .ff-intro, .ff-steps, .ff-section, .ff-blocked {
        padding: 40px 80px;
        border-radius: 16px;
        margin-bottom: 24px;
    }
    .ff-steps { padding: 24px 80px; }

    .ff-intro h1 { font-size: 26px; margin-bottom: 20px; }
    .ff-intro p, .ff-steps, .ff-section .ff-lead { font-size: 16px; }

    .ff-section-head { font-size: 26px; margin: 40px 0 25px; }
    .ff-section-head::before { width: 20px; height: 20px; flex: 0 0 20px; }

    /* 項目名は左に固定幅（.fp-row__label と同じ 180px ＋ 右20px） */
    .ff-row { display: flex; align-items: flex-start; padding: 15px 0; }
    .ff-label {
        flex: 0 0 180px; width: 180px;
        padding: 8px 20px 0 0;
        margin-bottom: 0;
        font-size: 16px;
        box-sizing: border-box;
    }
    .ff-field { flex: 1 1 0; }

    .ff-input, .ff-select, .ff-textarea, .ff-choice, .ff-eq-name,
    .ff-unit, .ff-hint, .ff-hint a, .ff-hint button.link, .ff-time, .ff-day, .ff-foot {
        font-size: 16px;
    }
    .ff-input { max-width: 520px; }
    .ff-select { max-width: 260px; }
    .ff-textarea { max-width: 100%; }
    .ff-day { width: 50px; flex: 0 0 50px; }
    .ff-time { width: 220px; }

    .ff-choices.cols3 { grid-template-columns: repeat(3, 1fr); }
    .ff-topic-head { font-size: 16px; }

    /* 16px だと3列では項目名が折り返す（「一人になれる場所」など）。2列にする */
    .ff-eq-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 40px; }
    .ff-tri button { font-size: 14px; padding: 6px 14px; }

    .ff-blocked h2 { font-size: 26px; margin-bottom: 24px; }
    .ff-blocked p, .ff-blocked .ff-link, .ff-blocked .ff-actions .note { font-size: 16px; }
    .ff-blocked .ff-actions { margin-top: 56px; }

    .ff-error { font-size: 14px; }
}

/* ───────── スマホ（施設ページと同じく角を落として画面いっぱい） ───────── */
@media (max-width: 767px) {
    .ff-choices.cols3 { grid-template-columns: repeat(2, 1fr); }
    .ff-eq-grid { grid-template-columns: repeat(1, 1fr); }
    .ff-steps { gap: 8px; font-size: 13px; }
    .ff-time { width: 100%; }
    .ff-blocked .ff-actions .ff-btn { min-width: 0; width: 100%; }
}

/* ───────── 写真（モック「02.画像登録」・T-198）─────────
 * モックの実測×2.336：3列・枠の間 約42px、写真 4:3・角なし・灰色 #B5B5B6、
 * 「写真を差し替える」は青の小さいボタン、キャプションの入力。文字は施設ページの段階（T-195）にそろえる。
 */
.ffp-rule { font-size: 13px; color: #666; line-height: 1.8; margin: 0 0 24px; }
.ffp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 42px; }
.ffp-label { font-size: 15px; font-weight: 700; color: #898989; margin: 0 0 6px; }
.ffp-frame { display: block; aspect-ratio: 4 / 3; background: #B5B5B6; cursor: pointer; overflow: hidden; }
.ffp-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ffp-actions { margin: 10px 0 0; }
.ffp-btn { display: inline-block; padding: 7px 18px; border-radius: 4px; background: #469BFF; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.ffp-btn:hover { background: #1B7BEE; }
.ffp-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ffp-cap-label { display: block; margin: 14px 0 4px; font-size: 13px; color: #555; }
.ffp-submit { display: flex; justify-content: center; align-items: center; gap: 24px; margin: 32px 0 16px; }
.ffp-back { display: inline-flex; align-items: center; justify-content: center; padding: 14px 32px; border-radius: 6px; background: #B5B5B6; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; }
.ff-lead a { color: #2F8FFF; }
@media (max-width: 1023px) {
    .ffp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .ffp-btn { font-size: 13px; padding: 7px 12px; }
}

/* T-242。写真を外す（誰でも）・運営の非表示と戻す */
.ffp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ffp-remove { padding: 6px 12px; border: 1px solid #CFCFCF; border-radius: 4px; background: #fff; color: #595757; font-size: 13px; cursor: pointer; }
.ffp-remove:hover { border-color: #FB7AA5; color: #D6457A; }
.ffp-remove--op { border-color: #F2B8C9; color: #B8325E; }
.ffp-hidden-note { margin: 6px 0 0; font-size: 12px; color: #B8325E; }
.ffp-status { margin: 0 0 16px; padding: 10px 14px; border-radius: 6px; background: #F4F8FF; font-size: 14px; }
.ffp-removed__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.ffp-removed__list img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: .7; }
.ffp-removed__list p { margin: 6px 0; font-size: 12px; color: #666; }
@media (max-width: 1023px) {
    .ffp-removed__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ffp-remove { font-size: 12px; padding: 6px 10px; }
}

/* T-302。情報の修正・登録の冒頭の決まり */
/* 背景は付けない。上の文と同じ字で、少しあけて置く（2026-10-06 カトウさん） */
.ff-intro p.ff-rule { margin-top: 16px; }
.ff-rule a { color: #2F8FFF; text-decoration: underline; }

/* T-315。特に力を入れている学びで3つ選んだあと、押せない選択肢は薄く */
.ff-choice:has(input:disabled) { color: #AAAAAA; cursor: default; }

/* T-328。空にしても前の値が残る欄の一言。帯や囲みを付けない（ff-note と同じ文字だけ） */
.ff-kept { font-size: 12px; color: #898989; margin: 4px 0 0; line-height: 1.6; }

/* T-406。4軸の5段階（フリ活の記録の .pf-scale と同じ形）。箱を横一列に、言葉は箱の下。もう一度押すと外れる */
.ff-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 560px; }
.ff-scale__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; border: 0; background: none; cursor: pointer; color: #111; font-family: inherit; }
.ff-scale__step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 1px; background: #C9CACA; }
.ff-scale__step:first-child::before { display: none; }
.ff-scale__box { position: relative; z-index: 1; width: 26px; height: 26px; border: 1px solid #C9CACA; border-radius: 4px; background: #fff; box-sizing: border-box; }
.ff-scale__step.is-on .ff-scale__box { background: #2F8FFF; border-color: #2F8FFF; }
.ff-scale__step.is-on .ff-scale__box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.ff-scale__label { font-size: 12px; line-height: 1.4; text-align: center; color: #595757; }
.ff-scale__step.is-on .ff-scale__label { color: #111; font-weight: 700; }
.ff-scale__step:focus-visible .ff-scale__box { outline: 2px solid rgba(47, 143, 255, .5); outline-offset: 2px; }
@media (max-width: 1023px) { .ff-scale__label { font-size: 11px; } }
