/* =====================================================================
   情報の泉 / ピッタリ補助金 — 申込・相談フォーム プレミアムテーマ
   body.page-form 配下のみに適用（管理画面 style.css には影響しない）。
   Navy × Antique Brass / Shippori Mincho(明朝) × Zen Kaku Gothic New(ゴシック)
   ===================================================================== */

body.page-form {
    /* ---- palette ---- */
    --ink:        #16273f;   /* 主色（ネイビーインク） */
    --ink-2:      #233a5c;
    --ink-soft:   #4c586e;   /* 補助テキスト */
    --ink-faint:  #8b93a4;
    --brass:      #b0863a;   /* アンティークブラス（アクセント） */
    --brass-deep: #8a6626;
    --brass-soft: #d8b878;
    --paper:      #f4efe6;   /* 温かみのある背景 */
    --surface:    #ffffff;
    --surface-2:  #fffdf8;
    --line:       #e7dfce;   /* ヘアライン（温色） */
    --line-strong:#cdc3ad;
    --req:        #b0533c;   /* 必須バッジ */
    --ok:         #2c7a55;
    --ok-bg:      #e7f3ec;
    --err:        #b0402e;
    --err-bg:     #fbecea;

    --font-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --font-body: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont,
        "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
    --font-accent: "Outfit", var(--font-body);

    --r:    0;       /* 既定は直交（シャープ）＝意図的な角。丸はノードのみ */
    --r-sm: 0;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 1px 2px rgba(22,39,63,.06);
    --shadow-md: 0 10px 28px -14px rgba(22,39,63,.22), 0 2px 6px -2px rgba(22,39,63,.07);
    --shadow-lg: 0 32px 60px -32px rgba(22,39,63,.34), 0 10px 22px -14px rgba(22,39,63,.14);

    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(1100px 460px at 50% -180px, rgba(176,134,58,.12), transparent 72%),
        radial-gradient(820px 520px at 108% -40px, rgba(35,58,92,.08), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: .012em;
}

/* 微細なグレイン（控えめ） */
body.page-form::before {
    content: "";
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
/* 上部の極細アクセントバー */
body.page-form::after {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3;
    background: linear-gradient(90deg, var(--ink) 0%, var(--brass) 50%, var(--ink) 100%);
}

body.page-form .container { position: relative; z-index: 1; max-width: 760px; padding: 56px 22px 72px; }
body.page-form .container.narrow { max-width: 520px; }

/* ============================ ヒーロー ============================ */
body.page-form .form-hero { margin: 0 0 30px; }
body.page-form .eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--font-accent); font-weight: 600;
    font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--brass-deep); margin-bottom: 16px;
}
body.page-form .eyebrow::before {
    content: ""; width: 26px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--brass), var(--brass-soft));
}
body.page-form h1 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.85rem, 4.6vw, 2.6rem); line-height: 1.28;
    letter-spacing: .02em; color: var(--ink); margin: 0 0 14px;
}
body.page-form .lead {
    color: var(--ink-soft); font-size: 1.0rem; line-height: 1.95;
    margin: 0; max-width: 60ch;
}

/* ============================ ステップ ============================ */
body.page-form .steps {
    display: flex; gap: 0; list-style: none; padding: 0; margin: 34px 0 30px;
    counter-reset: step; border: 0; background: none;
}
body.page-form .steps li {
    position: relative; flex: 1; text-align: center;
    font-size: .82rem; font-weight: 700; color: var(--ink-faint);
    padding: 0; background: none; border-radius: 0;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
}
body.page-form .steps li::before {           /* 番号サークル */
    counter-increment: step; content: counter(step);
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-accent); font-size: .98rem; font-weight: 600;
    background: var(--surface); color: var(--ink-faint);
    border: 1.5px solid var(--line-strong); box-shadow: var(--shadow-sm);
    transition: .3s var(--ease);
}
body.page-form .steps li::after {            /* 連結線 */
    content: ""; position: absolute; top: 19px; left: -50%; width: 100%;
    height: 2px; background: var(--line-strong); z-index: -1;
}
body.page-form .steps li:first-child::after { display: none; }
body.page-form .steps li.active { color: var(--ink); }
body.page-form .steps li.active::before {
    background: var(--ink); color: #fff; border-color: var(--ink);
    box-shadow: 0 0 0 5px rgba(22,39,63,.10), var(--shadow-md);
}
body.page-form .steps li.done { color: var(--brass-deep); }
body.page-form .steps li.done::before {
    content: "✓"; background: linear-gradient(150deg, var(--brass) 0%, var(--brass-deep) 100%);
    color: #fff; border-color: var(--brass-deep);
}
body.page-form .steps li.done::after { background: var(--brass-soft); }

/* ============================ パネル ============================ */
body.page-form .panel {
    position: relative; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r);
    padding: 30px 30px 26px; margin-bottom: 20px; box-shadow: var(--shadow-md);
}
/* 直交の角に意図を：左上のブラスLブラケット（建築的ディテールを全カードに反復） */
body.page-form .panel::before {
    content: ""; position: absolute; top: -1px; left: -1px; width: 22px; height: 22px;
    border-top: 2px solid var(--brass); border-left: 2px solid var(--brass); pointer-events: none;
}
body.page-form h2 {
    font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
    letter-spacing: .03em; color: var(--ink);
    margin: 0 0 22px; padding: 0 0 14px; border: 0;
    border-bottom: 1px solid var(--line); position: relative;
}
body.page-form h2::after {
    content: ""; position: absolute; left: 0; bottom: -1px; width: 46px; height: 3px;
    border-radius: 3px; background: linear-gradient(90deg, var(--brass), var(--brass-soft));
}

/* ============================ フォーム ============================ */
body.page-form label { display: block; margin: 0 0 20px; font-weight: 700; font-size: .94rem; color: var(--ink); }
body.page-form .panel > label:last-child,
body.page-form .row2 label { margin-bottom: 0; }
body.page-form .row2 + label, body.page-form label + label { margin-top: 0; }

body.page-form label .req, body.page-form label .opt {
    display: inline-block; margin-left: 8px; padding: 2px 9px;
    font-family: var(--font-accent); font-size: .66rem; font-weight: 600;
    letter-spacing: .08em; border-radius: 0; vertical-align: middle; line-height: 1.5;
}
body.page-form label .req { background: var(--req); color: #fff; }
body.page-form label .opt { background: transparent; color: var(--ink-faint); border: 1px solid var(--line-strong); }

body.page-form input[type=text],
body.page-form input[type=email],
body.page-form input[type=number],
body.page-form textarea,
body.page-form select {
    width: 100%; margin-top: 10px; padding: 13px 15px; font-size: 1rem;
    font-family: inherit; color: var(--ink);
    background: var(--surface-2); border: 1.5px solid var(--line-strong);
    border-radius: var(--r-sm); box-shadow: inset 0 1px 2px rgba(22,39,63,.03);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
body.page-form input::placeholder, body.page-form textarea::placeholder { color: #aab0bd; }
body.page-form input:hover, body.page-form textarea:hover, body.page-form select:hover { border-color: var(--ink-faint); }
body.page-form input:focus, body.page-form textarea:focus, body.page-form select:focus {
    outline: none; background: #fff; border-color: var(--ink);
    box-shadow: inset 0 -2px 0 0 var(--brass), 0 0 0 3px rgba(176,134,58,.16);
}
body.page-form textarea { min-height: 120px; resize: vertical; line-height: 1.8; }

/* セレクトの矢印 */
body.page-form select {
    appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2316273f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
body.page-form .hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .82rem; line-height: 1.7; margin-top: 8px; }
body.page-form .hint strong { color: var(--brass-deep); font-weight: 700; }

body.page-form .row2 { display: flex; gap: 18px; }
body.page-form .inline-fields { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
body.page-form .inline-fields input { width: auto; flex: 1; margin-top: 0; }
body.page-form .inline-fields span { color: var(--ink-soft); font-size: .9rem; }

/* ============== カスタムチェックボックス ============== */
body.page-form input[type=checkbox] {
    appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0;
    width: 21px; height: 21px; border-radius: 0; cursor: pointer;
    background: #fff; border: 1.5px solid var(--line-strong);
    transition: .18s var(--ease); position: relative;
}
body.page-form input[type=checkbox]:hover { border-color: var(--brass); }
body.page-form input[type=checkbox]:checked {
    background-color: var(--ink); border-color: var(--ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 12 9 17 20 6'/%3E%3C/svg%3E");
    background-size: 14px; background-position: center; background-repeat: no-repeat;
}
body.page-form input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(176,134,58,.25); }

body.page-form .checkitem {
    display: inline-flex; align-items: center; gap: 9px; font-weight: 500;
    font-size: .92rem; color: var(--ink-soft); margin: 0; width: calc(50% - 9px);
    padding: 4px 0; cursor: pointer;
}
body.page-form .checkitem:hover { color: var(--ink); }
body.page-form .checkitem span { line-height: 1.4; }

/* ============== アコーディオン（業種・カテゴリー） ============== */
body.page-form details.acc {
    border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 12px;
    overflow: hidden; background: var(--surface-2); transition: box-shadow .2s var(--ease);
}
body.page-form details.acc[open] { box-shadow: var(--shadow-sm); }
body.page-form details.acc + details.acc { margin-top: 10px; }
body.page-form details.acc > summary {
    cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: .94rem;
    color: var(--ink); background: linear-gradient(180deg, #fff, var(--surface-2));
    list-style: none; user-select: none; display: flex; align-items: center; gap: 11px;
    transition: background .2s var(--ease);
}
body.page-form details.acc > summary::-webkit-details-marker { display: none; }
body.page-form details.acc > summary::before {
    content: ""; width: 8px; height: 8px; border-right: 2px solid var(--brass);
    border-bottom: 2px solid var(--brass); transform: rotate(-45deg); transition: transform .22s var(--ease);
    margin-left: 2px;
}
body.page-form details.acc[open] > summary::before { transform: rotate(45deg); }
body.page-form details.acc > summary:hover { background: #fff; }
body.page-form details.acc .acc-count { margin-left: auto; color: var(--brass-deep); font-family: var(--font-accent); font-weight: 600; font-size: .82rem; }
body.page-form details.acc .opts { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 18px 16px; border-top: 1px solid var(--line); }

/* ============================ ボタン ============================ */
body.page-form .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--ink); color: #fff; border: none;
    padding: 15px 32px; font-size: 1.02rem; font-weight: 700; font-family: inherit;
    letter-spacing: .04em; border-radius: var(--r-sm); cursor: pointer; text-decoration: none;
    box-shadow: var(--shadow-md); position: relative; overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
body.page-form .btn::after {  /* ブラスの光沢 */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(216,184,120,.30) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .6s var(--ease);
}
body.page-form .btn:hover { background: var(--ink-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
body.page-form .btn:hover::after { transform: translateX(120%); }
body.page-form .btn:active { transform: translateY(0); }
body.page-form .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
body.page-form .btn::before {  /* 進む矢印 */
    content: "→"; order: 2; font-family: var(--font-accent); font-weight: 600;
    transition: transform .25s var(--ease);
}
body.page-form .btn:hover::before { transform: translateX(4px); }
body.page-form .btn-sub, body.page-form .btn-sub:hover {
    background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line-strong); box-shadow: none;
}
body.page-form .btn-sub::before { content: "←"; order: -1; }
body.page-form .btn-sub:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
body.page-form .btn-sub:hover::before { transform: translateX(-4px); }
body.page-form .btn-block { width: 100%; }
body.page-form .actions { display: flex; gap: 14px; margin-top: 28px; }
body.page-form .actions.spread { justify-content: space-between; }

/* ============================ 確認テーブル ============================ */
body.page-form .review { width: 100%; border-collapse: collapse; }
body.page-form .review th, body.page-form .review td {
    text-align: left; padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem;
}
body.page-form .review tr:last-child th, body.page-form .review tr:last-child td { border-bottom: 0; }
body.page-form .review th {
    width: 38%; background: none; font-weight: 700; color: var(--ink-soft);
    font-size: .85rem; letter-spacing: .02em;
}
body.page-form .review td { color: var(--ink); font-weight: 500; }

/* ============================ 通知 ============================ */
body.page-form .notice {
    padding: 15px 18px; border-radius: var(--r-sm); margin: 0 0 22px; font-size: .94rem;
    font-weight: 500; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start;
}
body.page-form .notice::before { content: ""; flex: 0 0 3px; align-self: stretch; border-radius: 0; }
body.page-form .notice-info { background: #eef2f7; color: var(--ink-2); }
body.page-form .notice-info::before { background: var(--ink-2); }
body.page-form .notice-ok { background: var(--ok-bg); color: var(--ok); }
body.page-form .notice-ok::before { background: var(--ok); }
body.page-form .notice-error { background: var(--err-bg); color: var(--err); }
body.page-form .notice-error::before { background: var(--err); }

body.page-form .field-error { display: block; color: var(--err); font-size: .84rem; font-weight: 600; margin-top: 8px; }
body.page-form label.has-error input, body.page-form label.has-error select,
body.page-form .has-error textarea, body.page-form .has-error input { border-color: var(--err); }
body.page-form .card-note { font-size: .88rem; color: var(--ink-soft); line-height: 1.8; margin: 0 0 4px; }

/* ============================ 同意 ============================ */
body.page-form .agree {
    font-weight: 500; display: flex; gap: 12px; align-items: flex-start;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 16px 18px; margin: 0; font-size: .94rem; color: var(--ink-soft);
}
body.page-form .agree input { margin-top: 2px; }
body.page-form .agree a, body.page-form .lead a { color: var(--brass-deep); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--brass-soft); transition: .2s; }
body.page-form .agree a:hover, body.page-form .lead a:hover { color: var(--ink); border-color: var(--ink); }

/* ============================ 完了画面 ============================ */
body.page-form .done-box { text-align: center; padding: 52px 28px 44px; }
body.page-form .done-box .mark {
    width: 84px; height: 84px; margin: 0 auto 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: 2.4rem; color: #fff; line-height: 1;
    background: linear-gradient(150deg, var(--brass) 0%, var(--brass-deep) 100%);
    box-shadow: 0 0 0 10px rgba(176,134,58,.12), var(--shadow-md);
    animation: pop .6s var(--ease) both .1s;
}
body.page-form .done-box h1 { font-size: 1.7rem; margin-bottom: 16px; }
body.page-form .done-box p { color: var(--ink-soft); line-height: 1.9; }
body.page-form .done-box strong { font-family: var(--font-accent); color: var(--ink); letter-spacing: .06em; }

/* ============================ フッター ============================ */
body.page-form footer.site-foot {
    position: relative; z-index: 1; text-align: center; font-size: .82rem;
    color: var(--ink-faint); padding: 28px 20px 48px;
    border-top: 1px solid var(--line); margin-top: 12px;
}
body.page-form footer.site-foot a { color: var(--ink-soft); margin: 0 12px; text-decoration: none; transition: color .2s; }
body.page-form footer.site-foot a:hover { color: var(--brass-deep); }

/* ============================ アニメーション ============================ */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 60% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
body.page-form .form-hero, body.page-form .steps, body.page-form .panel,
body.page-form .actions, body.page-form .notice { animation: riseIn .7s var(--ease) both; }
body.page-form .form-hero { animation-delay: .02s; }
body.page-form .steps { animation-delay: .08s; }
body.page-form .panel:nth-of-type(1) { animation-delay: .14s; }
body.page-form .panel:nth-of-type(2) { animation-delay: .20s; }
body.page-form .panel:nth-of-type(3) { animation-delay: .26s; }
body.page-form .panel:nth-of-type(4) { animation-delay: .32s; }
body.page-form .panel:nth-of-type(5) { animation-delay: .38s; }
body.page-form .actions { animation-delay: .42s; }

/* ============================ レスポンシブ ============================ */
@media (max-width: 600px) {
    body.page-form .container { padding: 40px 16px 56px; }
    body.page-form .panel { padding: 22px 18px; border-radius: 13px; }
    body.page-form .row2 { flex-direction: column; gap: 0; }
    body.page-form .row2 label { margin-bottom: 20px; }
    body.page-form .checkitem { width: 100%; }
    body.page-form .actions { flex-direction: column-reverse; }
    body.page-form .actions .btn { width: 100%; }
    body.page-form .steps li { font-size: .72rem; }
    body.page-form .review th { width: 40%; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.page-form *, body.page-form *::before, body.page-form *::after { animation: none !important; transition: none !important; }
}
