/* ==============================
  LINEの中で開く依頼フォーム（liff.html）
  サイト本体のCSSは読み込まない（固定背景・BGMなどはLINE内では不要）。
  色と角丸だけサイトの値に合わせる。
============================== */
:root {
  --accent: #0060d8;
  --accent-dark: #00409c;
  --navy: #0a1526;
  --text: #1a1f2e;
  --text-light: #667085;
  --border: #d0d5dd;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --line: #06c755;
  --line-dark: #05a948;
  --ng: #c62828;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* サイト本体と同じ：1枚の写真に白いベールを掛けた下地 */
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)) center / cover no-repeat,
    url('../img/Airmax_base.JPG') center / cover no-repeat,
    var(--bg-alt);
  color: var(--text);
  font-family: -apple-system, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 16px; /* iOS で入力欄にフォーカスしたとき拡大されないよう 16px 以上 */
  line-height: 1.7;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.liff {
  max-width: 560px;
  margin: -18px auto 0; /* 帯に少し重ねる（サイトの「丸い縁で重なる面」に寄せる） */
  padding: 0 16px 40px;
  position: relative;
  z-index: 1;
}

/* ── ヒーロー帯（サイトのファーストビューと同じ作り） ── */
.liff-hero {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 26px 16px 22px;
  /* 写真の上部（配達のシーン）を切り出し、濃紺で減光する */
  background: url('../img/Airmax_base.JPG') center top / cover no-repeat var(--navy);
}

.liff-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /* サイトの .section-hero::before と同じ値。夜景で暗いので減光は薄めでよい */
  background: linear-gradient(to bottom, rgba(10, 20, 40, 0.30) 0%, rgba(10, 20, 40, 0.44) 55%, rgba(10, 20, 40, 0.58) 100%);
}

.liff-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
}

.liff-logo {
  width: 210px;
  height: auto;
}

.liff-title {
  margin: 8px 0 0;
  font-family: 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', -apple-system, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.liff-lead {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.sp-br { display: inline; }
@media (min-width: 480px) { .sp-br { display: none; } }

/* サイトの hero-facts と同じ、細い罫線で区切った事実の並び */
.liff-facts {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 16px auto 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  max-width: 420px;
}

.liff-facts div {
  flex: 1 1 0;
  position: relative;
  padding: 0 8px;
}

.liff-facts div + div::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.liff-facts dt {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.62);
}

.liff-facts dd {
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.liff-status {
  margin: 12px 0 0;
  min-height: 1.4em;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}

.liff-status.is-error {
  color: var(--ng);
  font-weight: 700;
}

/* ── 「配達中」「休止」の一言 ── */
.ops-notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff4e6;
  border: 1px solid #f0d0a0;
  color: #7a4a00;
  font-size: 0.86rem;
  line-height: 1.6;
}

.ops-notice.is-off {
  background: #fdecec;
  border-color: #e8b4b4;
  color: #8a1f1f;
}

/* ── 前回の依頼 ── */
.last {
  margin: 12px 0 14px;
  padding: 16px 16px 14px;
  background: #eaf9f0;
  border: 1px solid #bfe8cf;
  border-radius: 16px;
}

.last-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
}

.last-summary {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-light);
  white-space: pre-line;
}

.last-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.last-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.last-btn--yes {
  background: var(--line);
  border-color: var(--line);
  color: #fff;
}

.last-btn--danger {
  border-color: #e8b4b4;
  color: var(--ng);
}

.open {
  margin: 12px 0 14px;
  padding: 16px 16px 14px;
  background: #fff7e8;
  border: 1px solid #f0d0a0;
  border-radius: 16px;
}

.history {
  margin: 12px 0 14px;
  padding: 14px 16px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.history-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.history-item b {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 400;
}

.history-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

/* ── 料金の目安 ── */
.quote-box {
  margin: 4px 0 12px;
}

.quote-btn {
  display: block;
  width: 100%;
  padding: 12px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.quote-btn:disabled { opacity: 0.6; cursor: wait; }

.quote-result {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--line-soft, #eaf9f0);
  color: #1a7f37;
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-line;
}

.quote-result.is-out {
  background: #fdecec;
  color: var(--ng);
}

.quote-result.is-info {
  background: var(--bg-alt);
  color: var(--text-light);
}

/* ── フォーム ── */
.liff-form {
  margin-top: 0;
  background: var(--bg);
  border-radius: 16px;
  padding: 18px 16px 20px;
  box-shadow: 0 1px 2px rgba(30, 45, 75, 0.04), 0 8px 22px rgba(30, 45, 75, 0.07);
}

.field + .field {
  margin-top: 16px;
}

.label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.req, .opt {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.req { background: #fdecec; color: var(--ng); }
.opt { background: var(--bg-alt); color: var(--text-light); }

.input {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}

.input + .input {
  margin-top: 8px;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-light);
}

.count {
  margin: 4px 0 0;
  text-align: right;
  font-size: 0.76rem;
  color: var(--text-light);
}

/* 現在地ボタン */
.gps-btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: #eef4fd;
  color: var(--accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.gps-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.gps-btn.is-done {
  background: #e8f5ee;
  border-color: var(--line-dark);
  color: var(--line-dark);
}

.gps-status {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-light);
  display: none;
}

.gps-status.is-visible { display: block; }
.gps-status.is-error { color: var(--ng); }

.error {
  margin: 14px 0 0;
  min-height: 1.4em;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ng);
}

/* 送信ボタン */
.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 16px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(6, 140, 60, 0.28);
  cursor: pointer;
}

.submit svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.submit:active { transform: scale(0.99); }
.submit:disabled { opacity: 0.6; cursor: wait; box-shadow: none; }

.submit--ghost {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}

.note {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
}

/* ── 送信後・LINE外 ── */
.done, .outside {
  margin-top: 14px;
  background: var(--bg);
  border-radius: 16px;
  padding: 28px 18px 22px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(30, 45, 75, 0.04), 0 8px 22px rgba(30, 45, 75, 0.07);
}

.done-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--line);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 56px;
}

.done-title {
  margin: 14px 0 0;
  font-size: 1.2rem;
}

.done-lead, .outside-lead {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text-light);
  white-space: pre-line; /* 受付番号・料金の目安を改行つきで出す */
}

.liff-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
}

.liff-foot a {
  color: var(--accent);
  font-weight: 700;
}
