/* ==========================================================================
   ポータル共通デザインシステム & スマートフォン完全最適化CSS
   ========================================================================== */

:root {
  --primary: #06c755;
  --primary-hover: #05b34c;
  --primary-subtle: #f0fdf4;
  --primary-border: #bbf7d0;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: var(--slate-900);
  --muted: var(--slate-500);
  --border: rgba(15, 23, 42, 0.08);

  --danger: #ef4444;
  --warning: #f59e0b;
  --warning-subtle: #fef3c7;
  --warning-text: #92400e;
  --info: #0284c7;
  --info-subtle: #e0f2fe;

  --nav-height: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* スマホスクロール時の弾みやスムーズさ */
body {
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

/* 共通コンテナ */
.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

/* カードスタイル */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-card:active {
  transform: scale(0.995);
}

/* ボタン基本スタイル */
.btn-core {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
  user-select: none;
}
.btn-core:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-dark {
  background: var(--slate-900);
  color: #ffffff;
}
.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border);
}

/* フォーム入力要素 */
.input-core {
  width: 100%;
  appearance: none;
  background: #ffffff;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--slate-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-core:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.18);
}

/* スピナー */
.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(15, 23, 42, 0.08);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ボトムナビゲーション完全対応 */
.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.app-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--slate-400);
  font-size: 10.5px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 6px 0;
  position: relative;
  cursor: pointer;
  transition: color 0.15s ease;
}
.app-nav-item.active,
.app-nav-item[aria-current="page"] {
  color: var(--primary);
}
.app-nav-item .material-icons {
  font-size: 22px;
  transition: transform 0.15s ease;
}
.app-nav-item:active .material-icons {
  transform: scale(0.88);
}

.app-badge-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
  display: none;
}
