/* ==========================================================
 *    税研ウェブサービス ログインページ
 * ========================================================== */

:root {
  --accent: #0B6BCB;
  --accent-hover: #0959AA;
  --accent-shadow: rgba(11, 107, 203, 0.25);

  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --ink: #0F1B2D;
  --ink-sub: #334155;
  --muted: #4A5568;
  --border: #E3E8EF;
  --border-input: #C9D2DE;
  --divider: #EEF1F5;
  --tag-bg: #F1F4F8;

  --important-bg: #FDECEC; --important-fg: #B42318; --important-row: #FFF9F8;
  --maint-bg: #FFF1E0;     --maint-fg: #8A4300;
  --issue-bg: #E3F5F2;     --issue-fg: #0F6B5C;
  --support-bg: #E6F0FB;   --support-fg: #0A4F94;

  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-card: 0 1px 2px rgba(15, 27, 45, 0.04), 0 8px 24px rgba(15, 27, 45, 0.06);
  --focus-ring: 0 0 0 3px rgba(11, 107, 203, 0.35);

  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

[hidden] { display: none !important; }

/* ---------- アイコン ---------- */
.icon {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--accent { width: 20px; height: 20px; color: var(--accent); }

/* ---------- レイアウト ---------- */
.container { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.main {
  padding-top: 40px; padding-bottom: 56px;
  display: flex; flex-direction: column; gap: 40px;
}

.top-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

/* ---------- ヘッダー ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner {
  padding-top: 10px; padding-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand__name { display: none; font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }

.link-icon {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.link-icon:hover { text-decoration: underline; }

/* ---------- ログイン ---------- */
.login {
  flex: 1 1 380px; max-width: 440px; min-width: 0;
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.login__title { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.login__lead { margin: 0 0 24px; font-size: 13px; color: var(--muted); }
.login__form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 700; }
.field__input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border-input); border-radius: var(--radius-input);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; /* iOSのズーム防止のため16px以上 */
  transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: #8A94A6; }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field__input[aria-invalid="true"] { border-color: var(--important-fg); }

.field__pw { position: relative; }
.field__input--pw { padding-right: 52px; }
.pw-toggle {
  position: absolute; top: 2px; right: 2px;
  width: 44px; height: 44px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pw-toggle .icon { width: 20px; height: 20px; }
.pw-toggle:hover { color: var(--ink); background: var(--tag-bg); }
.pw-toggle .icon--eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .icon--eye { display: none; }
.pw-toggle[aria-pressed="true"] .icon--eye-off { display: block; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.btn-primary {
  height: 52px; border: 0; border-radius: var(--radius-input);
  background: var(--accent); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 0.1em;
  cursor: pointer; box-shadow: 0 2px 6px var(--accent-shadow);
  transition: background-color .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }
/* 入力欄どうしの間隔（gap 18px + ラベル行 約21px + ラベル下 6px）に揃える */
.login__form .btn-primary { margin-top: 27px; }

.login__help {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.help-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; font-size: 14px; text-decoration: none;
}
.help-link:hover { text-decoration: underline; }

nav.login__help { display: none; }
.login__help--note p { margin: 0; font-size: 13px; color: var(--muted); }
.login__help--note p + p { margin-top: 8px; }

.form-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin: 0 0 20px;
  border: 1px solid #F5C2BE; border-radius: 10px;
  background: var(--important-bg); color: #8F1D14;
}
.form-alert .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--important-fg); }
.form-alert__title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.form-alert__text  { margin: 0; font-size: 13px; }
.field__input[aria-invalid="true"] { border: 1.5px solid var(--important-fg); }

/* ---------- 見出し ---------- */
.section-head { display: flex; align-items: center; gap: 8px; }
.section-title { margin: 0; font-size: 18px; font-weight: 700; }

/* ---------- お知らせ ---------- */
.news { flex: 999 1 520px; min-width: 0; overflow: hidden; }
.news__head { padding: 22px 24px 0; }
.news__filters {
  padding: 14px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip-btn {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-input); background: var(--surface); color: var(--ink-sub);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

.news__list { list-style: none; margin: 0; padding: 0; }
.news-item { border-bottom: 1px solid var(--divider); background: var(--surface); }
.news-item:last-child { border-bottom: 0; }
.news-item--important { background: var(--important-row); }

.news-item__btn {
  width: 100%; min-height: 60px; padding: 14px 20px 14px 24px;
  display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.news-item__btn:hover .news-item__title { color: var(--accent); }
.news-item__main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px;
}
.news-item__meta { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.news-item__meta time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-item__title { flex: 1 1 240px; min-width: 0; font-size: 15px; font-weight: 500; }
.news-item__chev { color: var(--muted); transition: transform .2s; }
.news-item__btn[aria-expanded="true"] .news-item__chev { transform: rotate(180deg); }
.news-item__body { padding: 0 24px 18px; font-size: 14px; color: var(--muted); }
.news__empty { margin: 0; padding: 24px; font-size: 14px; color: var(--muted); }

/* お知らせ本文（メンテ画面の告知を移植） */
.news-item__body { color: var(--ink); line-height: 1.8; }
.news-item__body p { margin: 0 0 10px; }
.news-item__body a { font-weight: 700; }
.news-item__body h3 {
  margin: 20px 0 10px; padding-bottom: 4px; border-bottom: 2px solid #CFE0EF;
  font-size: 15px; font-weight: 700;
}
.news-item__body h3:first-child { margin-top: 0; }
.news-item__body h4 {
  margin: 16px 0 8px; padding-left: 8px; border-left: 4px solid #9DBFDC;
  font-size: 14px; font-weight: 700; color: var(--support-fg);
}
.news-item__body ul { margin: 0 0 14px; padding-left: 1.6em; }
.news-item__body li { margin: 0 0 4px; }
.news-item__body table {
  width: 100%; border-collapse: collapse; margin: 8px 0 18px;
  font-size: 13px; line-height: 1.6; background: var(--surface);
}
.news-item__body th, .news-item__body td {
  border: 1px solid #CFE0EF; padding: 8px 12px; text-align: left; vertical-align: top;
}
.news-item__body thead th { background: var(--support-bg); color: var(--support-fg); white-space: nowrap; }
.news-item__body tbody tr:nth-child(even) { background: #F8FBFE; }
.news-item__body td:first-child { width: 34%; font-weight: 700; }
/* 「データベー/ス」のような単語途中の折り返しを防ぐ(読点では折り返せる) */
.news-item__body td { word-break: keep-all; overflow-wrap: anywhere; }

/* ○△× 見出し・一覧 */
.news-item__body h3.mark { display: flex; align-items: center; gap: 8px; }
.mark-sym {
  flex: none; color: var(--accent); font-size: 20px; font-weight: 900; line-height: 1;
  -webkit-text-stroke: 1.5px var(--accent);
}
.news-item__body ul.mark-o { list-style-type: '○ '; }
.news-item__body ul.mark-t { list-style-type: '△ '; }
.news-item__body ul.mark-x { list-style-type: '× '; }
.news-item__body .indent { margin-left: 2em; }
.news-item__body .table-wrap { overflow-x: auto; }
.news-item__body div.sep { margin: 0 0 14px 2em; border-top: 1px solid var(--divider); height: 0; }
.news-item__body p.lead-tight { margin-bottom: 2px; }
.news-item__body p.example { margin: -6px 0 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.news-item__body h4.plain { border-left: 0; padding-left: 0; }

/* メンテナンス中機能（サービスごと）表 */
.tbl-maint td { vertical-align: top; line-height: 1.7; }
.tbl-maint th[scope="row"] { white-space: nowrap; text-align: left; font-weight: 600; vertical-align: top; }
.tbl-maint__common { background: rgba(220, 38, 38, 0.06); }
.tbl-maint__common th[scope="row"] { color: #b91c1c; }
.tbl-maint__sub { display: block; font-size: 0.8em; font-weight: 400; color: inherit; opacity: 0.8; }
.tbl-maint__none { opacity: 0.7; }
@media (prefers-color-scheme: dark) {
  .tbl-maint__common { background: rgba(248, 113, 113, 0.12); }
  .tbl-maint__common th[scope="row"] { color: #fca5a5; }
}

.badge {
  display: inline-block; min-width: 56px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-align: center;
}
.badge--important { background: var(--important-bg); color: var(--important-fg); }
.badge--maint     { background: var(--maint-bg);     color: var(--maint-fg); }
.badge--issue     { background: var(--issue-bg);     color: var(--issue-fg); }

/* ---------- ご利用案内 ---------- */
.guide { display: flex; flex-direction: column; gap: 16px; }
.guide__products { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.guide__lead { margin: 0; font-size: 15px; font-weight: 700; }

.product-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.product-group { display: flex; flex-direction: column; gap: 8px; }
.product-group__name { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 4px 10px; border-radius: 8px; background: var(--tag-bg); font-size: 13px; color: #1E293B; }

.note { margin: 0; font-size: 12px; color: var(--muted); }
.guide__products .link-icon { align-self: flex-start; }

.guide__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.info-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.info-card__text { margin: 0; font-size: 14px; flex: 1 1 auto; }
.info-card .link-icon { align-self: flex-start; }

.tag {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
  background: #EEF1F5; color: var(--ink-sub); font-size: 12px; font-weight: 700;
}
.tag--support { background: var(--support-bg); color: var(--support-fg); }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__inner { padding-top: 20px; padding-bottom: 20px; font-size: 12px; color: var(--muted); text-align: center; }



/* ---------- スマートフォン ---------- */
@media (max-width: 600px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .main { padding-top: 24px; gap: 32px; }
  .login { padding: 24px 20px; }
  .news__head, .news__filters { padding-left: 16px; padding-right: 16px; }
  .news-item__btn { padding-left: 16px; padding-right: 12px; }
  .news-item__body { padding-left: 16px; padding-right: 16px; }
  .news-item__body .indent, .news-item__body div.sep { margin-left: 0; }
  .guide__products { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
