@import url("./search-modal.css");

/* ========================================
   HP Theme — Nexus Technologies
   ======================================== */

/* --- 検索バー --- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--hp-surface);
  border-bottom: 1px solid var(--hp-border);
}

.top-nav__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav__search input {
  min-width: 220px;
  max-width: 45vw;
  height: 36px;
  padding: 0 0.6rem;
  background: var(--hp-bg);
  border: 1px solid var(--hp-border);
  color: var(--hp-text);
  border-radius: 6px;
}

.top-nav__search input::placeholder {
  color: var(--hp-text-muted);
}

.top-nav__search button {
  height: 36px;
  padding: 0 0.75rem;
  background: var(--hp-accent);
  border: 1px solid var(--hp-accent);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.top-nav__search button:hover {
  background: var(--hp-accent-light);
  border-color: var(--hp-accent-light);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- ページカウンター（YACHO UI: 右下に現在ページ/総ページ数を表示） --- */
.page-counter,
#page-counter {
  position: fixed;
  right: 12px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  padding: 0.5rem 0.875rem;
  border-radius: 100px;
  pointer-events: none;
  z-index: 9999;
}

/* --- フッター: HPテーマに合わせたデザイン --- */
footer,
.site-footer {
  position: static;
  margin-top: 3rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 1.5rem 2rem;
  background: var(--hp-surface);
  border-top: 1px solid var(--hp-border);
  color: var(--hp-text-muted);
  font-size: 0.78rem;
}
/* --- カラーパレット --- */
:root {
  --hp-bg: #0a0a14;
  --hp-surface: #12121f;
  --hp-surface-hover: #1a1a2e;
  --hp-text: #d4d4e0;
  --hp-text-muted: #8888a0;
  --hp-accent: #06b6d4;
  --hp-accent-light: #22d3ee;
  --hp-accent-green: #10b981;
  --hp-border: #1e1e35;
  --hp-gradient: linear-gradient(135deg, #06b6d4, #8b5cf6);
}

/* --- 認証フォーム（テーマ連動） --- */
:root {
  --auth-surface: #12121f;
  --auth-border: #1e1e35;
  --auth-text: #d4d4e0;
  --auth-text-muted: #8888a0;
  --auth-label: #8888a0;
  --auth-input-bg: #0a0a14;
  --auth-accent: #06b6d4;
  --auth-btn-bg: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --auth-hint: #f0c040;
  --auth-hint-bg: rgba(240,192,64,0.1);
}


/* --- レイアウト --- */
body {
  background: var(--hp-bg);
  color: var(--hp-text);
  margin: 0;
}

/* ★ スティッキーフッター: Flexboxで最下部に固定 */
.site-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex-grow: 1;
}

/* --- ヘッダー --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  margin-bottom: 0;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--hp-accent-light);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.site-title:hover {
  color: #67e8f9;
  text-decoration: none;
}

/* ヘッダー内ナビゲーション */
.header-nav {
  display: flex;
  gap: 0.2rem;
}

.header-nav__link {
  color: var(--hp-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.header-nav__link:hover {
  color: var(--hp-text);
  background: var(--hp-surface-hover);
}

.header-nav__link--active {
  color: var(--hp-accent-light);
}

/* --- ヒーローセクション --- */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid var(--hp-border);
}

.hero__title {
  font-size: 2rem;
  font-weight: 800;
  background: var(--hp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--hp-text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- ナビゲーションリンク --- */
.nav-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--hp-accent);
  border-radius: 8px;
  color: var(--hp-accent-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--hp-accent);
  color: #000;
  text-decoration: none;
}

.nav-link--primary {
  background: var(--hp-gradient);
  border: none;
  color: #fff;
}

.nav-link--primary:hover {
  opacity: 0.85;
  color: #fff;
}

/* --- セクション --- */
.section {
  margin-bottom: 3rem;
}

.section__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--hp-accent-light);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--hp-border);
}

/* --- カードグリッド --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--hp-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.1);
}

.card__icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--hp-text);
  margin-bottom: 0.5rem;
}

.card__desc {
  font-size: 0.85rem;
  color: var(--hp-text-muted);
  line-height: 1.6;
}

/* --- テーブル --- */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.info-table th,
.info-table td {
  padding: 0.8rem 1rem;
  border: 1px solid var(--hp-border);
  text-align: left;
}

.info-table th {
  background: var(--hp-surface);
  color: var(--hp-accent-light);
  font-weight: 600;
  width: 30%;
}

.info-table td {
  background: var(--hp-bg);
}

/* --- フォーム --- */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--hp-text-muted);
  margin-bottom: 0.3rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: 8px;
  color: var(--hp-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--hp-accent);
}

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

.form-btn {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--hp-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.form-btn:hover {
  opacity: 0.85;
}

/* --- 戻るリンク --- */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--hp-accent-light);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #67e8f9;
  text-decoration: underline;
}

/* --- お知らせリスト --- */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hp-border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item__date {
  color: var(--hp-text-muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-item__badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-item__badge--new {
  background: var(--hp-accent);
  color: #000;
}

.news-item__text {
  font-size: 0.92rem;
}

/* --- 数字で見る Nexus --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat {
  text-align: center;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: 10px;
  padding: 1.5rem 1rem;
  transition: border-color 0.2s;
}

.stat:hover {
  border-color: var(--hp-accent);
}

.stat__number {
  font-size: 2rem;
  font-weight: 800;
  background: var(--hp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--hp-text-muted);
}

/* --- レスポンシブ --- */
@media (max-width: 600px) {
  .site-container {
    padding: 0 1rem 0;
  }
  .site-header {
    flex-direction: column;
    gap: 0.8rem;
  }
  .header-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero {
    padding: 2.5rem 1.5rem;
  }
  .hero__title {
    font-size: 1.5rem;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    flex-direction: column;
    align-items: center;
  }
  .news-item {
    flex-wrap: wrap;
  }
}

/* --- 全ページ共通アカウントメニュー --- */
.account-menu {
  position: fixed;
  top: 0.7rem;
  right: 1rem;
  /* top-nav（100）より前、検索モーダル（1000）より後ろに配置する。 */
  z-index: 200;
  color: #26374a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* 検索ボタンとアカウントアイコンが重ならないよう、共通ナビに表示領域を確保する。 */
.top-nav { padding-right: 4.3rem; }

.account-menu__trigger {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  background: #fff;
  border: 1px solid #9fb9d5;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(9, 47, 105, 0.18);
  cursor: pointer;
}

.account-menu__trigger:hover,
.account-menu__trigger:focus-visible {
  border-color: #1768c5;
  outline: none;
}

.account-menu__icon {
  width: 18px;
  height: 18px;
  background:
    radial-gradient(circle at 50% 30%, #6b7f94 0 22%, transparent 24%),
    radial-gradient(ellipse at 50% 100%, #6b7f94 0 43%, transparent 45%);
}

.account-menu__badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: none;
  width: 10px;
  height: 10px;
  background: #1b9a59;
  border: 2px solid #fff;
  border-radius: 50%;
}

.account-menu--logged-in .account-menu__badge { display: block; }

.account-menu__panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(330px, calc(100vw - 2rem));
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #cbd8e6;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(9, 47, 105, 0.22);
}

.account-menu__panel[hidden] { display: none; }

.account-menu__panel h2 {
  margin: 0 0 1rem;
  color: #092f69;
  font-size: 1rem;
}

.account-menu__form label {
  display: block;
  margin: 0.7rem 0 0.25rem;
  color: #385878;
  font-size: 0.78rem;
  font-weight: 700;
}

.account-menu__form input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 0.7rem;
  color: #26374a;
  background: #f8fbff;
  border: 1px solid #9fb9d5;
  border-radius: 7px;
}

.account-menu__form input:focus {
  border-color: #1768c5;
  box-shadow: 0 0 0 3px rgba(23, 104, 197, 0.14);
  outline: none;
}

.account-menu__submit {
  width: 100%;
  min-height: 40px;
  margin-top: 1rem;
  color: #fff;
  background: #1768c5;
  border: 0;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
}

.account-menu__error {
  margin: 0.7rem 0 0;
  color: #b42318;
  font-size: 0.8rem;
}

.portal-home {
  max-width: 620px;
  margin: 12vh auto 0;
  padding: 3rem;
  text-align: center;
}

.portal-home__eyebrow {
  color: var(--hp-accent-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

@media (max-width: 600px) {
  .top-nav__search input { min-width: 0; }
  .portal-home { padding: 2rem 1.25rem; }
}
