:root {
    --primary:       #3c3c3c;
    --primary-dark:  #1a1a1a;
    --primary-light: #f0f0f0;
    --primary-mid:   #b0b0b0;
    --error:         #cc3333;
    --error-bg:      #fff5f5;
    --success:       #2d8a5f;
    --border:        #d9d9d9;
    --border-focus:  #3c3c3c;
    --bg:            #e0e0e0;
    --surface:       #ffffff;
    --text:          #333333;
    --text-muted:    #777777;
    --radius-sm:     4px;
    --radius:        8px;
    --radius-lg:     12px;
    --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg:     0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ── ヘッダー ── */
.site-header {
    background: #f5f5f5;
    padding: 24px 32px;
    border-bottom: 1px solid #d0d0d0;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    letter-spacing: .04em;
}
.site-header-text p { font-size: 13px; color: #777; margin-top: 4px; }
.site-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 20px;
    }
    .site-logo {
        align-self: flex-start;
    }
}

/* ── レイアウト ── */
.container { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }

/* ── 完了画面 ── */
.done-hero {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 24px;
}
.done-hero-banner {
    background: #f5f5f5;
    padding: 40px 44px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #d0d0d0;
}
.done-check-icon {
    flex-shrink: 0;
    width: 56px; height: 56px;
    background: #e0e0e0;
    border: 2px solid #b0b0b0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #333;
}
.done-hero-banner h2 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    letter-spacing: .03em;
    margin-bottom: 4px;
}
.done-hero-banner p { font-size: 13px; color: #777; }

.done-hero-body { padding: 32px 44px; }

.done-received-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* 確認テーブル */
.done-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.done-table caption {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 8px;
}
.done-table th {
    width: 180px;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    background: #f5f5f5;
    border: 1px solid var(--border);
    vertical-align: top;
}
.done-table td {
    padding: 12px 14px;
    border: 1px solid var(--border);
    color: var(--text);
    line-height: 1.7;
    vertical-align: top;
    white-space: pre-wrap;
    word-break: break-all;
}
.done-table tr:first-child th { border-top-left-radius: var(--radius-sm); }
.done-table tr:first-child td { border-top-right-radius: var(--radius-sm); }
.done-table tr:last-child th  { border-bottom-left-radius: var(--radius-sm); }
.done-table tr:last-child td  { border-bottom-right-radius: var(--radius-sm); }

.done-notice {
    margin-top: 24px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.7;
}
.done-notice strong { display: block; margin-bottom: 4px; }

.done-back-area { text-align: center; margin-top: 32px; }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 12px 36px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-back:hover { background: #f0f0f0; }

@media (max-width: 600px) {
    .done-hero-banner { padding: 24px 20px; }
    .done-hero-body   { padding: 24px 20px; }
    .done-table th    { width: 120px; }
}

/* ── エラーサマリー ── */
.error-summary {
    background: var(--error-bg);
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.error-summary-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.error-summary strong { display: block; color: var(--error); font-size: 14px; margin-bottom: 6px; }
.error-summary ul { padding-left: 18px; font-size: 13px; color: #b91c1c; }
.error-summary li + li { margin-top: 3px; }

/* ── フォームカード ── */
.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.form-card-body { padding: 40px 44px; }
.form-intro { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.8; }
.form-intro em { color: var(--error); font-style: normal; }

/* ── フォーム行 ── */
.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0 24px;
    align-items: flex-start;
    padding: 22px 0;
    border-top: 1px solid var(--border);
}
.form-row:last-of-type { border-bottom: 1px solid var(--border); }

/* 条件表示行 */
.cond-row { display: none; }
.cond-row.visible {
    display: grid;
    animation: fadeSlide .22s ease;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── ラベル ── */
.row-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    padding-top: 8px;
    line-height: 1.5;
}
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: .03em;
}
.badge-req { background: #fee2e2; color: #b91c1c; }
.badge-opt { background: var(--border); color: var(--text-muted); }

/* ── 入力要素 ── */
.field-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: border-color .18s, box-shadow .18s, background .18s;
    appearance: none;
}
.field-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.field-input.is-error {
    border-color: var(--error);
    background: var(--error-bg);
}
.field-input.is-error:focus { box-shadow: 0 0 0 3px #fee2e2; }

select.field-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
textarea.field-input { resize: vertical; min-height: 130px; line-height: 1.7; }

/* ── 名前 2列 ── */
.name-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }

/* ── オプション（ラジオ・チェック）── */
.option-group { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
}
.option-pill:hover { border-color: #888; background: #f7f7f7; }
.option-pill input[type="radio"],
.option-pill input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.option-pill:has(input:checked) {
    border-color: var(--primary);
    background: #ebebeb;
    color: var(--primary);
    font-weight: 600;
}

/* ── ファイルアップロード ── */
.file-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.file-input { display: none; }
.file-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #f5f5f5;
    border: 1.5px solid #b0b0b0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    transition: background .15s;
}
.file-label:hover .file-btn { background: #e8e8e8; }
.file-name {
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-all;
}
.file-name.selected { color: var(--text); font-weight: 600; }

/* ── ヒントテキスト ── */
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── エラーメッセージ ── */
.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--error);
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    animation: fadeSlide .15s ease;
}
.field-error::before { content: '⚠'; font-size: 13px; }

/* ── プライバシーボックス ── */
.privacy-scroll {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    max-height: 160px;
    overflow-y: auto;
    background: #fafbfc;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}
.privacy-scroll a { color: #555; text-decoration: underline; }
.privacy-scroll a:hover { text-decoration: underline; }

/* ── 文字数カウンター ── */
.char-counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 5px;
}
.char-counter.warn { color: var(--error); font-weight: 600; }

/* ── 送信エリア ── */
.submit-area { padding: 32px 0 8px; text-align: center; }
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    color: #333;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 14px 52px;
    border: 1.5px solid #b0b0b0;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    transition: background .15s, box-shadow .15s;
}
.btn-submit:hover { background: #e8e8e8; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.btn-submit:active { background: #ddd; }

/* ── レスポンシブ ── */
@media (max-width: 600px) {
    .form-card-body, .submit-area { padding: 24px 20px; }
    .form-row { grid-template-columns: 1fr; gap: 8px; }
    .row-label { padding-top: 0; }
    .name-pair { grid-template-columns: 1fr; }
}
