/* 今津リフレッシュ農園 公開側デザインシステム v3
   基準: docs/design.md（公式サイト https://imazu-refresh-farm.jp のテーマ変数に統一）
   原則: 文字16px以上 / コントラスト比4.5:1以上 / 1ページ型フォーム（01 非機能要件） */
:root {
    /* 色（design.md §1） */
    --bg: #fbfaf7;
    --paper: #ffffff;
    --ink: #333333;
    --muted: #6b7263;
    --line: #e3e1d8;
    --line-strong: #cfccbe;
    --green: #5d704a;          /* 公式 --color_main */
    --green-dark: #465438;     /* 公式 --color_main_dark */
    --green-soft: #eef1e8;
    --green-mist: #f4f6ef;
    --accent: #af5235;         /* 公式 --color_deep04 テラコッタ */
    --accent-soft: #f7ece6;
    --red: #d1111c;            /* 公式カスタムボタン赤 */
    --yellow: #8a6116;

    /* 形 */
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 4px rgba(51, 51, 51, .08);
    --shadow-md: 0 2px 8px rgba(51, 51, 51, .10), 0 4px 4px -4px rgba(51, 51, 51, .10);

    /* 書体（公式と同じ游ゴシック。Webフォント不使用） */
    --font-body: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.9;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); text-underline-offset: 3px; }

:focus-visible {
    outline: 3px solid #a4b18b;
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ヘッダー: 白地+上端にメイン色の帯（公式ヘッダーの引用） */
.site-header {
    background: #fdfdfd;
    border-top: 4px solid var(--green);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.site-logo {
    width: 38px;
    height: 42px;
    flex: none;
    display: flex;
    align-items: center;
}
.site-logo img { width: 100%; height: auto; display: block; }
.site-title {
    color: var(--green-dark);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    line-height: 1.3;
}
.site-subtitle {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--accent);
    width: 100%;
    padding-left: 50px;
    margin-top: -6px;
}
@media (min-width: 560px) {
    .site-subtitle { width: auto; padding-left: 0; margin-top: 4px; margin-left: auto; }
}

.container {
    max-width: 768px;
    margin: 0 auto;
    padding: 22px 18px 64px;
}

/* フッター: テラコッタ（公式フッターの引用） */
.site-footer {
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    text-align: center;
    padding: 30px 16px 36px;
    margin-top: 32px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: #ffe3d2; }
.footer-logo {
    width: 34px;
    height: auto;
    margin: 0 auto 8px;
    display: block;
    filter: brightness(0) invert(1);
    opacity: .95;
}

/* 見出し */
h1 {
    font-size: clamp(25px, 5.2vw, 30px);
    line-height: 1.55;
    letter-spacing: .03em;
    margin: 20px 0 14px;
    font-weight: 700;
    color: var(--ink);
}
h2 {
    font-size: 20px;
    letter-spacing: .05em;
    margin: 34px 0 16px;
    font-weight: 700;
    padding-bottom: 10px;
    position: relative;
}
h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--green) 0 64px, #ddd9cc 64px);
}

/* ヒーロー */
.hero {
    background:
        radial-gradient(120% 140% at 85% -20%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(140deg, #3f4c33 0%, #5d704a 55%, #6b7d54 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 40px 28px 36px;
    margin: 10px 0 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.hero-art {
    position: absolute;
    right: -22px;
    bottom: -30px;
    width: 190px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: .12;
    pointer-events: none;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
    color: #eef2e6;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 999px;
    padding: 3px 16px;
    margin: 0 0 14px;
}
.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 6vw, 38px);
    line-height: 1.5;
    letter-spacing: .05em;
    color: #fff;
}
.hero-lead {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 2.0;
    color: #eef2e6;
    max-width: 33em;
}
.hero-cta {
    display: inline-block;
    background: #fff;
    color: var(--green-dark);
    font-size: 17.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 14px 30px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
    transition: transform .12s ease, box-shadow .12s ease;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .26); }

/* カード基本 */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* イベントカード */
.event-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    position: relative;
}
.event-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.event-card-grid {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 430px) {
    .event-card-grid { grid-template-columns: 64px 1fr; gap: 14px; }
}

/* 開催日タイル */
.date-tile {
    background: var(--green-mist);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
    padding: 10px 4px 8px;
    line-height: 1.25;
}
.date-tile-month {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--accent);
}
.date-tile-day {
    display: block;
    font-size: 30px;
    font-weight: 700;
    color: var(--green-dark);
}
.date-tile-dow { display: block; font-size: 12.5px; color: var(--muted); }
.date-tile-extra {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--green-dark);
    background: #fff;
    border-radius: 999px;
    margin: 6px 4px 0;
    padding: 1px 0;
    border: 1px solid var(--line);
}

.event-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.event-card h3 {
    margin: 2px 0 6px;
    font-size: 21px;
    line-height: 1.5;
    letter-spacing: .02em;
    font-weight: 700;
}
.event-card-arrow {
    position: absolute;
    right: 18px;
    bottom: 16px;
    color: var(--green);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .06em;
}
.event-dates { margin: 0 0 2px; font-size: 15px; color: var(--muted); }
.event-meta { margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--muted); }
.event-meta li { margin: 2px 0; }

/* 種別チップ（design.md §4 の色対応） */
.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
}
.type-harvest { background: var(--accent-soft); color: #93421f; }
.type-cooking { background: #fbe7e7; color: #a61218; }
.type-lecture { background: #e6eef8; color: #1e5e9e; }
.type-farm_plot { background: var(--green-soft); color: var(--green-dark); }
.type-other { background: #ededeb; color: #55584f; }

.badge {
    display: inline-block;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 13px;
    border-radius: 999px;
    color: #fff;
    background: var(--green);
}
.badge-closed { background: #84887c; }

.deadline-badge {
    display: inline-block;
    font-size: 13.5px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--green);
    color: var(--green-dark);
}
.deadline-badge.is-urgent { background: var(--red); border-color: var(--red); color: #fff; }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 999px;
    padding: 3px 13px;
    color: var(--ink);
}
.pill strong { color: var(--accent); }

/* ボタン: ピル形+メイン色（公式ボタン様式） */
.btn {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 17px;
    margin: 18px 0;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: transform .1s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: scale(.99); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(70, 84, 56, .32); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(70, 84, 56, .36); }
.btn-secondary { background: transparent; color: var(--green-dark); border: 1.5px solid var(--green); }
.btn-secondary:hover { background: var(--green-soft); }
.btn-mini {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--green);
    background: #fff;
    color: var(--green-dark);
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background .12s ease;
}
.btn-mini:hover { background: var(--green-soft); }

/* ステップバー */
.steps { display: flex; list-style: none; margin: 20px 0 26px; padding: 0; }
.steps li {
    flex: 1;
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--muted);
    position: relative;
    padding-top: 38px;
}
.steps li::before {
    content: attr(data-no);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 31px;
    height: 31px;
    line-height: 29px;
    border-radius: 50%;
    background: var(--paper);
    border: 1.5px solid var(--line-strong);
    color: var(--muted);
    font-size: 15px;
}
.steps li::after {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 1.5px;
    background: var(--line-strong);
}
.steps li:last-child::after { display: none; }
.steps li.is-active { color: var(--green-dark); }
.steps li.is-active::before {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    box-shadow: 0 0 0 5px var(--green-soft);
}
.steps li.is-done { color: var(--green-dark); }
.steps li.is-done::before { content: "✓"; background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.steps li.is-done::after { background: var(--green); }

/* フォーム: 章立てカード */
.form-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px 12px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.form-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18.5px;
    font-weight: 700;
    letter-spacing: .04em;
    margin: 0 0 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--line);
}
.form-card-title::after { display: none; }
.form-card-no {
    width: 28px;
    height: 28px;
    line-height: 28px;
    flex: none;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 14.5px;
    text-align: center;
}

.form-group { margin-bottom: 24px; }
.form-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 17px; letter-spacing: .02em; }
.required-mark {
    display: inline-block;
    color: #fff;
    background: var(--red);
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    padding: 1px 9px;
    margin-left: 8px;
    vertical-align: 2px;
    letter-spacing: .08em;
}
.optional-mark {
    display: inline-block;
    color: var(--muted);
    background: #eceae2;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    padding: 1px 9px;
    margin-left: 8px;
    vertical-align: 2px;
}
.form-hint { font-size: 15px; color: var(--muted); margin: 2px 0 8px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select, textarea {
    width: 100%;
    font-size: 18px;
    padding: 13px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
}

.radio-list { display: flex; flex-direction: column; gap: 9px; }
.radio-item {
    display: flex;
    align-items: center;
    gap: 11px;
    background: #fff;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 18px;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}
.radio-item:has(input:checked) {
    border-color: var(--green);
    background: var(--green-mist);
    box-shadow: 0 0 0 3px var(--green-soft);
}
.radio-item input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }

.checkbox-item { display: flex; align-items: flex-start; gap: 11px; font-size: 17px; }
.checkbox-item input { width: 22px; height: 22px; margin-top: 7px; accent-color: var(--green); flex: none; }

.error-box {
    background: #fdecec;
    border: 1.5px solid var(--red);
    border-radius: 12px;
    color: #a30d16;
    padding: 13px 17px;
    margin-bottom: 16px;
    font-weight: 700;
}
.field-error { color: #a30d16; font-size: 15px; font-weight: 700; margin-top: 5px; }

.notice-box {
    background: var(--green-mist);
    border: 1px solid #ccd5bd;
    border-radius: 12px;
    padding: 14px 17px;
    font-size: 16px;
}

/* 受付番号・完了 */
.receipt-code-box {
    text-align: center;
    border: 2px solid var(--green);
    border-radius: var(--radius-lg);
    background: var(--paper);
    padding: 30px 20px 26px;
    margin: 22px 0;
    box-shadow: var(--shadow-md);
}
.receipt-code-label { font-size: 15px; color: var(--muted); letter-spacing: .04em; }
.receipt-code {
    font-size: 47px;
    font-weight: 700;
    letter-spacing: 12px;
    color: var(--green-dark);
    font-family: "Consolas", "Courier New", monospace;
    margin: 2px 0;
}
.complete-check {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 32px;
    line-height: 62px;
    text-align: center;
    margin: 2px auto 14px;
    box-shadow: 0 0 0 7px var(--green-soft);
}

/* 当日までの流れ */
.timeline { list-style: none; margin: 14px 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 46px; font-size: 16px; }
.timeline li::before {
    content: attr(data-icon);
    position: absolute;
    left: 0;
    top: 0;
    width: 33px;
    height: 33px;
    line-height: 33px;
    text-align: center;
    background: var(--green-mist);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 16px;
}
.timeline li::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 37px;
    bottom: 3px;
    width: 1.5px;
    background: var(--line-strong);
}
.timeline li:last-child::after { display: none; }
.timeline .timeline-title { font-weight: 700; display: block; }
.timeline .timeline-note { color: var(--muted); font-size: 15px; }

/* 確認テーブル */
.confirm-table { width: 100%; border-collapse: collapse; background: transparent; }
.confirm-table th, .confirm-table td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
    vertical-align: top;
}
.confirm-table tr:last-child th, .confirm-table tr:last-child td { border-bottom: none; }
.confirm-table th { width: 9em; color: var(--accent); font-weight: 700; font-size: 14.5px; letter-spacing: .06em; padding-top: 16px; }

/* 当落表示 */
.status-banner {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 22px;
    border-radius: var(--radius);
    margin: 16px 0;
}
.status-won { background: var(--green-mist); color: var(--green-dark); border: 2px solid var(--green); }
.status-lost { background: #f2f3f1; color: #444; border: 2px solid #9aa39b; }
.status-waiting { background: #fbf4df; color: var(--yellow); border: 2px solid #c89b3c; }

/* QR受付（スタッフ用・スマホ最適化） */
.checkin-page .container { max-width: 480px; }
#qr-reader { width: 100%; border-radius: 14px; overflow: hidden; background: #000; min-height: 240px; }
.checkin-result { text-align: center; border-radius: var(--radius); padding: 26px 16px; margin: 16px 0; }
.checkin-ok { background: var(--green-mist); border: 4px solid var(--green); }
.checkin-completed { background: var(--green); color: #fff; box-shadow: var(--shadow-md); }
.checkin-completed a { color: #fff; }
.checkin-already { background: #fbf4df; border: 4px solid #c89b3c; color: var(--yellow); }
.checkin-invalid { background: #fdecec; border: 4px solid var(--red); color: #a30d16; }
.checkin-name { font-size: 30px; font-weight: 700; margin: 8px 0; }
.checkin-party { font-size: 42px; font-weight: 700; margin: 8px 0; }
.checkin-event { font-size: 18px; }

/* 受付名簿（印刷用） */
.roster-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.roster-table th, .roster-table td { border: 1px solid #888; padding: 6px 8px; text-align: left; }
.roster-check { width: 3em; text-align: center; }
@media print {
    .site-header, .site-footer, .no-print { display: none; }
    body { background: #fff; font-size: 12px; }
    .container { max-width: none; padding: 0; }
}
