/* =============================================================================
   Cafe Reservation — Uber 風 2ステップ UI
   設計方針: 余白ベース・カード中央寄せ・入力よりも「選択」感を重視
   ============================================================================= */

/* ---- ベース ---- */
.crp-app {
	max-width: var(--card-max-width, 480px);
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #111111;
	-webkit-font-smoothing: antialiased;
}

/* ---- カード共通 ---- */
.crp-card {
	background: #ffffff;
	border-radius: var(--card-radius, 16px);
	padding: var(--card-padding, 28px 24px 24px);
	box-shadow: var(--card-shadow, 0 1px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07));
	margin-bottom: 12px;
}

/* ---- ステップバッジ ---- */
.crp-step-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--desc-color, #999);
	text-transform: uppercase;
	margin-bottom: 8px;
}

.crp-step-badge--active {
	color: #111111;
}

/* ---- カードタイトル ---- */
.crp-app h2.crp-card-title {
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 20px;
	color: #111111;
	line-height: 1.3;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 0;
	background: none;
}

/* =============================================================================
   タップ行（STEP1: 人数 / 日付 / 時間）
   ============================================================================= */

.crp-row {
	position: relative;       /* native input のオーバーレイ基点 */
	display: flex;
	align-items: center;
	padding: var(--row-padding, 16px 0);
	border-bottom: 1px solid var(--border-color-light, #e9e9e9);
	cursor: pointer;
	transition: background 0.1s;
	border-radius: 0;
}

.crp-row:last-of-type {
	border-bottom: none;
}

.crp-row:active {
	background: #f6f6f6;
}

/* 行の本文（ラベル＋値） */
.crp-row-body {
	flex: 1;
	min-width: 0;
}

.crp-row-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--label-color, #666);
	margin-bottom: 3px;
}

.crp-row-val {
	display: block;
	font-size: 1rem;
	font-weight: 500;
	color: #111111;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.crp-row-val--placeholder {
	color: #aaaaaa;
	font-weight: 400;
}

/* 矢印 */
.crp-row-arrow {
	font-size: 1.2rem;
	color: #cccccc;
	margin-left: 8px;
	flex-shrink: 0;
	line-height: 1;
}

/* native input / select を行全体に透明で重ねる */
.crp-row-native {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	font-size: 16px; /* iOS ズーム防止 */
}

/* 行の状態 */
.crp-row--selected .crp-row-val {
	color: #111111;
}

.crp-row--disabled {
	opacity: 0.35;
	pointer-events: none;
	cursor: default;
}

.crp-row--error {
	border-bottom-color: #e53e3e;
}

/* タップ行直下のエラー */
.crp-row-error {
	display: block;
	font-size: 0.8rem;
	color: #e53e3e;
	margin: 4px 0 8px;
	min-height: 1em;
}

/* STEP1 エラーメッセージ */
.crp-step-error {
	font-size: 0.875rem;
	color: #e53e3e;
	margin: 12px 0 4px;
	line-height: 1.4;
}

/* =============================================================================
   CTA ボタン（黒・全幅）
   ============================================================================= */

.crp-btn {
	display: block;
	width: 100%;
	height: 52px;
	background: #111111;
	color: #ffffff;
	border: none;
	border-radius: var(--btn-radius, 10px);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	margin-top: 22px;
	transition: opacity 0.15s;
}

.crp-btn:hover {
	opacity: 0.82;
}

.crp-btn:active {
	opacity: 0.7;
}

.crp-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* =============================================================================
   STEP 2 カード（インライン展開）
   ============================================================================= */

/* 表示時のエントランスアニメーション */
#crp-step2:not([hidden]) {
	animation: crpFadeSlideIn 0.25s ease both;
}

@keyframes crpFadeSlideIn {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---- サマリーボックス ---- */
.crp-summary {
	background: #f6f6f6;
	border-radius: var(--btn-radius, 10px);
	padding: 14px 16px;
	margin-bottom: 22px;
}

.crp-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 4px 0;
	font-size: 0.9rem;
}

.crp-summary-label {
	color: var(--label-color, #666);
}

.crp-summary-val {
	font-weight: 600;
	color: #111111;
}

/* ---- フィールド ---- */
.crp-field {
	margin-bottom: 20px;
}

.crp-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--label-color, #666);
	margin-bottom: 7px;
}

/* 必須バッジ */
.crp-badge-required {
	font-size: 0.65rem;
	background: #111111;
	color: #ffffff;
	padding: 2px 6px;
	border-radius: 4px;
	letter-spacing: 0.04em;
	font-weight: 700;
}

/* 任意バッジ */
.crp-badge-optional {
	font-size: 0.65rem;
	background: #f0f0f0;
	color: #888888;
	padding: 2px 6px;
	border-radius: 4px;
	letter-spacing: 0.03em;
	font-weight: 400;
}

/* フィールド説明文 */
.crp-field-desc {
	font-size: 0.78rem;
	color: var(--desc-color, #999);
	margin: 0 0 7px;
}

/* テキスト入力 */
.crp-input {
	display: block;
	width: 100%;
	height: 48px;
	border: 1.5px solid #e9e9e9;
	border-radius: 8px;
	padding: 0 14px;
	font-size: 1rem;
	color: #111111;
	background: #ffffff;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
}

.crp-input::placeholder {
	color: #bbbbbb;
}

.crp-input:focus {
	outline: none;
	border-color: #111111;
	box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

/* フィールドエラー状態 */
.crp-field--error .crp-input {
	border-color: #e53e3e;
}

/* フィールドエラーメッセージ */
.crp-field-error {
	display: block;
	font-size: 0.8rem;
	color: #e53e3e;
	margin-top: 5px;
	min-height: 1.1em;
}

/* ---- 備考 折りたたみ ---- */
.crp-note-section {
	margin-bottom: 20px;
}

.crp-note-toggle {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	background: none;
	border: none;
	border-bottom: 1px solid var(--border-color-light, #e9e9e9);
	padding: 13px 0;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--label-color, #666);
	cursor: pointer;
	text-align: left;
	transition: color 0.15s;
}

.crp-note-toggle:hover {
	color: #111111;
}

.crp-note-icon {
	font-size: 1rem;
	transition: transform 0.2s;
	flex-shrink: 0;
}

/* 展開時にアイコンを回転 */
.crp-note-toggle[aria-expanded="true"] .crp-note-icon {
	transform: rotate(45deg);
}

/* 備考テキストエリア */
.crp-note-body {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease, padding 0.25s ease;
}

.crp-note-body.is-open {
	max-height: 200px;
	padding-top: 12px;
}

.crp-textarea {
	display: block;
	width: 100%;
	border: 1.5px solid #e9e9e9;
	border-radius: 8px;
	padding: 12px 14px;
	font-size: 1rem;
	font-family: inherit;
	color: #111111;
	background: #ffffff;
	box-sizing: border-box;
	resize: vertical;
	min-height: 80px;
	transition: border-color 0.15s;
}

.crp-textarea::placeholder {
	color: #bbbbbb;
}

.crp-textarea:focus {
	outline: none;
	border-color: #111111;
}

/* フォームエラー（全体） */
.crp-form-error {
	font-size: 0.875rem;
	color: #e53e3e;
	padding: 10px 14px;
	background: #fff5f5;
	border-radius: 8px;
	border: 1px solid #fed7d7;
	margin-top: 12px;
	line-height: 1.4;
}

/* 戻るボタン */
.crp-btn-text {
	display: block;
	width: 100%;
	background: none;
	border: none;
	color: #888888;
	font-size: 0.875rem;
	padding: 14px;
	cursor: pointer;
	text-align: center;
	transition: color 0.15s;
}

.crp-btn-text:hover {
	color: #111111;
}

/* =============================================================================
   完了画面
   ============================================================================= */

.crp-card--complete {
	text-align: center;
	padding: 40px 24px;
	animation: crpFadeSlideIn 0.3s ease both;
}

.crp-complete-check {
	width: 60px;
	height: 60px;
	background: #111111;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	margin: 0 auto 20px;
}

.crp-app h2.crp-complete-title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 10px;
}

.crp-complete-msg {
	color: #555555;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.crp-complete-summary {
	background: #f6f6f6;
	border-radius: var(--btn-radius, 10px);
	padding: 14px 16px;
	font-size: 0.9rem;
	text-align: left;
}

/* =============================================================================
   受付停止中の案内
   ============================================================================= */

.crp-notice {
	padding: 1em 1.2em;
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeeba;
	border-radius: var(--btn-radius, 10px);
	font-size: 0.9rem;
}

/* =============================================================================
   カスタムカレンダー（シングル日付選択）
   ============================================================================= */
.crp-cal-wrap { padding: 12px 4px 20px; }
.crp-cal { user-select: none; -webkit-user-select: none; }
.crp-cal-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 14px; }
.crp-cal-nav { background: none; border: none !important; outline: none !important; box-shadow: none !important; font-size: 24px; cursor: pointer; padding: 4px 10px; color: #111; line-height: 1; border-radius: 8px; transition: background 0.1s; }
.crp-cal-nav:hover { background: #f0f0f0; }
.crp-cal-title-btn { background: none; border: none !important; outline: none !important; box-shadow: none !important; font-size: 16px; font-weight: 600; cursor: pointer; color: #111; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; transition: background 0.1s; }
.crp-cal-title-btn:hover { background: #f0f0f0; }
.crp-cal-title-arrow { font-size: 11px; color: var(--label-color, #666); transition: transform 0.2s; display: inline-block; }
.crp-cal-title-arrow.is-open { transform: rotate(180deg); }
.crp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.crp-cal-dow { text-align: center; font-size: 12px; color: #888; padding: 6px 0; font-weight: 600; }
.crp-cal-day { text-align: center; border-radius: 12px; font-size: 16px; font-weight: 500; cursor: pointer; transition: background 0.15s; min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; }
.crp-cal-day:not(.crp-cal-day--disabled):not(.crp-cal-day--selected):hover { background: #f0f0f0; }
.crp-cal-day--disabled { color: #ddd; cursor: default; pointer-events: none; }
.crp-cal-day--selected { background: #111 !important; color: #fff !important; border-radius: 12px; }
.crp-cal-day--today { color: #0070f3; font-weight: 700; }
.crp-cal-day--today.crp-cal-day--disabled { color: #ddd; }
.crp-cal-day--today:not(.crp-cal-day--disabled):not(.crp-cal-day--selected) { color: #0070f3; box-shadow: inset 0 0 0 1.5px #0070f3; }
.crp-cal-month-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0 8px; }
.crp-cal-month-item { text-align: center; padding: 12px 4px; border-radius: var(--btn-radius, 10px); font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.1s; }
.crp-cal-month-item--current { background: #111; color: #fff; }
.crp-cal-month-item--past { color: #ddd; cursor: default; pointer-events: none; }
.crp-cal-month-item:not(.crp-cal-month-item--current):not(.crp-cal-month-item--past):hover { background: #f0f0f0; }


/* --- 土日（予約なし）セル --- */
.crp-cal-day--no-res {
  cursor: default;
}
.crp-cal-day--no-res .crp-cal-day-num {
  text-decoration: line-through;
  text-decoration-color: #bbb;
  color: #ccc;
  font-size: 14px;
  display: block;
}
.crp-cal-day--no-res:hover {
  background: transparent;
  cursor: default;
}
