/* ============================================================
   NOBORITO ARCH — User Side CSS
   カフェの温かみ × 都会的シンプル
   ============================================================ */

:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --primary-light: #f39c5a;
    --secondary: #2c3e50;
    --accent: #27ae60;
    --bg: #faf7f2;
    --bg-card: #ffffff;
    --text: #333333;
    --text-sub: #888888;
    --text-light: #aaaaaa;
    --border: #e8e2d9;
    --border-light: #f0ebe3;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --nav-height: 56px;
    --header-height: 48px;
    --font: system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

/* リセット */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ヘッダー */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
}
.header-inner {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}
.header-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

/* メインコンテンツ */
.app-main {
    max-width: 480px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 12px) 16px calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    min-height: 100dvh;
}
body:not(.has-nav) .app-main {
    padding-bottom: 24px;
}

/* 下部ナビ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 6px 0;
}
.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary); }
.nav-icon { width: 24px; height: 24px; }

/* フラッシュメッセージ */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: flashIn 0.3s ease;
}
.flash-success { background: #eafaf1; color: #1a7a42; border: 1px solid #a3e4bc; }
.flash-error { background: #fdf0ef; color: #c0392b; border: 1px solid #f5b7b1; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash.fade-out { opacity: 0; transition: opacity 0.3s ease; }

/* カード */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}
.card-meta {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 4px;
}
.card-body { font-size: 14px; }
.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: var(--border-light);
}
.card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #1a2a3a; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #219a52; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 14px 24px; border-radius: var(--radius); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }

/* フォーム */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(230,126,34,0.15); }
.form-input::placeholder { color: var(--text-light); }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ページタイトル */
.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 16px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-sub);
    margin-top: -12px;
    margin-bottom: 16px;
}

/* セクション */
.section { margin-bottom: 24px; }
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-more { font-size: 13px; color: var(--primary); font-weight: 500; }

/* バッジ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-bronze { background: #f0e6d3; color: #8B6914; }
.badge-silver { background: #e8eaed; color: #5f6368; }
.badge-gold { background: #fef3d0; color: #b8860b; }
.badge-platinum { background: #e8e0f0; color: #6a0dad; }

/* ステータスバッジ */
.status { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-open { background: #eafaf1; color: #27ae60; }
.status-full { background: #fdf0ef; color: #e74c3c; }
.status-closed { background: #e8eaed; color: #5f6368; }
.status-draft { background: #fef9e7; color: #f39c12; }
.status-pending { background: #fef9e7; color: #f39c12; }
.status-confirmed { background: #eafaf1; color: #27ae60; }
.status-cancelled { background: #e8eaed; color: #5f6368; }
.status-applied { background: #ebf5fb; color: #2980b9; }

/* グリッド */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* リストカード */
.list-card { display: flex; flex-direction: column; gap: 12px; }

/* スタンプカード */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.stamp-item {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--bg);
}
.stamp-item.filled {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ランクバー */
.rank-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--secondary) 0%, #3d566e 100%);
    border-radius: var(--radius);
    color: #fff;
    margin-bottom: 16px;
}
.rank-bar .rank-name { font-size: 18px; font-weight: 700; }
.rank-bar .rank-count { font-size: 12px; opacity: 0.8; }

/* QRボタン */
.qr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}
.qr-btn:hover { transform: translateY(-1px); color: #fff; }

/* モーダル */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* タブ */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}
.tab-item {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab-item.active { color: var(--primary); border-color: var(--primary); }

/* 空状態 */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-sub);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* 区切り */
.divider { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }

/* ユーティリティ */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-sub); }
.text-sm { font-size: 12px; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* LP専用 */
.lp-hero {
    text-align: center;
    padding: 48px 16px 32px;
}
.lp-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.lp-hero p {
    font-size: 16px;
    color: var(--text-sub);
    margin-bottom: 32px;
}
.lp-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}
.lp-feature {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}
.lp-feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--primary);
}
.lp-feature h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}
.lp-feature p {
    font-size: 13px;
    color: var(--text-sub);
}
.lp-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 40px;
}

/* カレンダー */
.calendar { width: 100%; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-day { padding: 8px 4px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.calendar-day:hover { background: var(--border-light); }
.calendar-day.today { background: var(--primary); color: #fff; }
.calendar-day.selected { background: var(--secondary); color: #fff; }
.calendar-day.disabled { color: var(--text-light); cursor: default; }
.calendar-weekday { font-size: 11px; color: var(--text-sub); font-weight: 600; padding: 4px; }

/* 時間スロット */
.time-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-slot {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.time-slot:hover { border-color: var(--primary); color: var(--primary); }
.time-slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-slot.unavailable { background: var(--border-light); color: var(--text-light); cursor: not-allowed; }

/* アニメーション */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.3s ease; }
