/* ==========================================================================
   CROCO ID — modern skin (design tokens + shared components)
   Loaded globally after biz.css. Presentational-only, layout-safe:
   deep per-screen work lives in each page's *.css.jsp.
   ========================================================================== */

:root {
  /* Brand (CROCO teal, kept & tuned for WCAG AA) */
  --c-brand-50:  #e9f7ef;
  --c-brand-100: #c8ecd6;
  --c-brand-200: #93d9af;
  --c-brand-500: #16a34a;   /* the brand hue — accents, links, marks (green 差し色) */
  --c-brand-600: #0e7c45;   /* button bg (white text = AA 5.3:1) */
  --c-brand-700: #0a6238;   /* hover / pressed */

  /* Neutrals */
  --c-ink:    #1a2b32;      /* headings */
  --c-body:   #38484f;      /* body text */
  --c-muted:  #6b7a82;      /* secondary / captions */
  --c-border: #e2e8ea;
  --c-border-strong: #cfd8dc;
  --c-surface:  #f7f9fa;    /* subtle fill */
  --c-surface-2:#ffffff;    /* cards */
  --c-page:     #f4f6f7;    /* page background */

  /* State */
  --c-success: #1a8a5a;
  --c-warning: #b9770a;
  --c-error:   #d64545;
  --c-info:    #0e7c45;

  /* Links & misc (separated so dark can brighten links without touching button fills) */
  --c-link:       #0e7c45;
  --c-link-hover: #0a6238;
  --c-warn-bg:    #fdf6ec;
  color-scheme: light;

  /* Radius / spacing / motion */
  --c-radius:    8px;
  --c-radius-sm: 6px;
  --c-radius-lg: 12px;
  --c-shadow:    0 1px 3px rgba(16,40,48,.07), 0 1px 2px rgba(16,40,48,.04);
  --c-maxw:      1000px;

  --c-font: -apple-system, BlinkMacSystemFont, "Segoe UI",
            "Hiragino Kaku Gothic ProN", "Hiragino Sans",
            "Yu Gothic Medium", "Noto Sans JP", Meiryo, sans-serif;
}

/* ---- base ------------------------------------------------------------- */
body {
  font-family: var(--c-font);
  color: var(--c-body);
  background: var(--c-page);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a       { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }
a:visited { color: var(--c-link); }

h1, h2, h3, h4, h5 { color: var(--c-ink); }

/* shared page/section titles (replaces the old title images) */
.c-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ink);
  margin: 16px 16px;
  padding: 0;
}
.c-auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ink);
  text-align: center;
  margin: 12px 0 20px;
  padding: 0;
}

/* ---- shared site header (default.jsp) --------------------------------- */
#header {
  width: 100%;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.site-header {
  max-width: var(--c-maxw);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  flex: none;
}
.site-brand:hover { text-decoration: none; }
/* Unified "CROCO ID" wordmark: one lockup, "ID" is a teal accent (no badge box). */
.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--c-ink);
}
.brand-badge {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--c-brand-500);
}
.site-tagline {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-muted);
  flex: 1 1 320px;
  min-width: 0;
}

/* ---- form controls (global polish) ----------------------------------- */
/* input:not([type]) — type属性なしの input はデフォルトで text 扱いだが
   属性セレクタにマッチしないため明示的に拾う */
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  font-family: var(--c-font);
  font-size: 14px;
  color: var(--c-ink);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--c-radius-sm);
  padding: 9px 11px;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-brand-500);
  box-shadow: 0 0 0 3px rgba(22,163,74,.18);
}
select { padding: 8px 11px; }

/* ---- buttons ---------------------------------------------------------- */
.c-btn {
  box-sizing: border-box; /* width:100%(.c-btn-block)時に padding/border でカラム幅を超えないように */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--c-font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 12px 20px;
  border-radius: var(--c-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.c-btn:hover { text-decoration: none; }
.c-btn-primary {
  background: var(--c-brand-600);
  color: #fff;
}
.c-btn-primary:hover { background: var(--c-brand-700); color: #fff; }
.c-btn-secondary {
  background: var(--c-surface-2);
  color: var(--c-ink);
  border-color: var(--c-border-strong);
}
.c-btn-secondary:hover { background: var(--c-surface); color: var(--c-ink); }
.c-btn-block { width: 100%; }

/* small inline action button (e.g. 変更 buttons on info) */
.c-btn-sm {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--c-radius-sm);
  background: var(--c-surface-2);
  color: var(--c-brand-700);
  border: 1px solid var(--c-border-strong);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.c-btn-sm:hover { background: var(--c-brand-50); border-color: var(--c-brand-200); }

/* ---- button loading state --------------------------------------------- */
/* crocoBtnStart / crocoBtnEnd（default.js）が付け外しする共通ローディング状態。
   押した瞬間にグレーアウト＋ボタン内スピナー表示し、応答が返るまで再クリックを防ぐ。 */
.c-btn-loading {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.c-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: none;
  vertical-align: -2px;
  margin-right: 6px;
  animation: c-btn-spin .7s linear infinite;
}
/* .c-btn は gap:6px で間隔を取るので margin は不要 */
.c-btn .c-btn-spinner { margin-right: 0; }
@keyframes c-btn-spin { to { transform: rotate(360deg); } }

/* ---- right sidebar service list (menu.jsp) --------------------------- */
/* セクション見出し（SUPPORT TOOLS / PLATFORM）— テーマ緑で見出しとして強調 */
.ra-section {
  margin: 24px 6px 12px;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--c-brand-500);
  color: var(--c-brand-500);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
}
/* サービスカード：ロゴ/名称と説明を中央寄せで統一 */
.ra-svc {
  display: block;
  text-align: center;
  padding: 16px 14px;
  margin: 0 6px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  background: var(--c-surface);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.ra-svc:hover { border-color: var(--c-brand-200); background: var(--c-surface-2); }
.ra-svc__logo {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0 auto 10px;
  padding: 8px 14px;
  box-sizing: border-box;
  background: #fff;           /* ロゴ出自(黒系SVG/背景付きJPG/PNG)を問わず視認できるよう白タイルに載せる */
  border-radius: 8px;
  object-fit: contain;
}
.ra-svc__name {
  display: block;
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ra-svc__desc {
  display: block;
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}
/* #right_area の a 下線を打ち消す */
#right_area .ra-svc,
#right_area .ra-svc:hover { text-decoration: none; }

/* logged-in/out CTA in the sidebar (menu.jsp) — replaces the old BIZ ID banner images */
.ra-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 6px 18px;
}
.ra-cta .c-btn { width: 100%; }
/* beat #right_area a underline & color (ID-specificity) so button labels stay clean/visible */
#right_area .ra-cta .c-btn,
#right_area .ra-cta .c-btn:hover { text-decoration: none; }
#right_area .ra-cta .c-btn-primary,
#right_area .ra-cta .c-btn-primary:hover { color: #fff; }
#right_area .ra-cta .c-btn-secondary,
#right_area .ra-cta .c-btn-secondary:hover { color: var(--c-ink); }

/* ---- responsive: collapse the fixed two-column shell on small screens - */
@media (max-width: 820px) {
  #body_area { width: auto !important; max-width: 100%; padding: 0 12px; }
  #main_area {
    width: auto !important;
    float: none !important;
    border-left: none !important;
    border-right: none !important;
  }
  #right_area {
    width: auto !important;
    float: none !important;
    margin: 20px 0 0 !important;
    border: none !important;
    border-top: 1px solid var(--c-border) !important;
  }
  .site-tagline { display: none; }
}

/* ==========================================================================
   Dark mode — token swap only. GATED behind html.c-skinned so it applies
   ONLY on screens migrated to these tokens; legacy screens stay light.
   Default = system (prefers-color-scheme); manual override via [data-theme].
   ========================================================================== */
html.c-skinned[data-theme="dark"] {
  color-scheme: dark;
  --c-page:     #0e1417;
  --c-surface:  #161d21;
  --c-surface-2:#1b2429;
  --c-ink:      #eaf1f3;
  --c-body:     #c2ced3;
  --c-muted:    #8b99a0;
  --c-border:   #28333a;
  --c-border-strong: #3a474e;
  --c-brand-50:  #123524;
  --c-brand-100: #16472e;
  --c-brand-200: #1d6b42;
  --c-link:       #4ade80;
  --c-link-hover: #6ee7a8;
  --c-warn-bg:    #33280f;
  --c-shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  html.c-skinned:not([data-theme="light"]) {
    color-scheme: dark;
    --c-page:     #0e1417;
    --c-surface:  #161d21;
    --c-surface-2:#1b2429;
    --c-ink:      #eaf1f3;
    --c-body:     #c2ced3;
    --c-muted:    #8b99a0;
    --c-border:   #28333a;
    --c-border-strong: #3a474e;
    --c-brand-50:  #123524;
    --c-brand-100: #16472e;
    --c-brand-200: #1d6b42;
    --c-link:       #4ade80;
    --c-link-hover: #6ee7a8;
    --c-warn-bg:    #33280f;
    --c-shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  }
}

/* skinned-page shell surfaces follow tokens (kept out of legacy pages) */
/* biz.css hardcodes #bodis to #FFFFFF; on skinned pages let the page bg show
   through instead (otherwise a full-width white band flanks the centered
   content — glaring in dark mode). */
html.c-skinned #bodis      { background: transparent; }
html.c-skinned #body_area  { background: transparent; }
html.c-skinned #right_area { background: var(--c-surface); }
/* biz.css column dividers are #CCCCCC (light); use token borders on skinned
   pages so they don't glow in dark mode. */
html.c-skinned #main_area,
html.c-skinned #right_area { border-color: var(--c-border); }

/* ---- theme toggle button (only shown on skinned pages) --------------- */
.site-theme-toggle {
  display: none;
  margin-left: auto;
  flex: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--c-radius);
  color: var(--c-muted);
  cursor: pointer;
  padding: 0;
  transition: color .15s, background .15s, border-color .15s;
}
html.c-skinned .site-theme-toggle { display: inline-flex; }
.site-theme-toggle:hover { color: var(--c-ink); background: var(--c-surface); border-color: var(--c-border-strong); }
.site-theme-toggle svg { width: 18px; height: 18px; display: block; }

/* ==========================================================================
   Shared account nav (navigation.js injects #bizsam_header / #bizsam_footer
   with inline styles). We do NOT edit navigation.js — it is embedded on other
   CROCO services via /nav/basic. Instead we override its inline styles with
   !important, scoped to pages that load crocoid.css (= bizid-jvm only), to
   modernise the top utility bar + footer and close the gap with the login UI.
   ========================================================================== */
#bizsam_header {
  background: #12171a !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: right !important;
  padding: 7px 22px !important;
  font-size: 12px !important;
}
#bizsam_header ul { margin: 0 !important; padding: 0 !important; display: inline-flex !important; flex-wrap: wrap; gap: 2px 4px; }
#bizsam_header li {
  float: none !important; display: inline-flex !important; align-items: center;
  padding: 2px 4px 2px 12px !important; background: none !important; border: none !important;
}
#bizsam_header a { color: #7bdcab !important; text-decoration: none !important; transition: color .15s; }
#bizsam_header a:hover { color: #aef0cf !important; text-decoration: none !important; }

#bizsam_footer {
  background: #12171a !important;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.6) !important;
  text-align: center !important;
  padding: 28px 20px !important;
  font-size: 12.5px !important;
  line-height: 1.7 !important;
}
#bizsam_footer ul {
  float: none !important; position: static !important; left: auto !important;
  display: flex !important; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 2px 0; margin: 0 auto 10px !important; padding: 0 !important;
}
#bizsam_footer li {
  float: none !important; position: static !important; left: auto !important;
  padding: 1px 14px !important; margin: 0 !important; line-height: 1.3;
  border-right: 1px solid rgba(255,255,255,.16) !important; background: none !important;
}
#bizsam_footer ul li:last-child { border-right: none !important; }
#bizsam_footer a { color: #5fd39a !important; text-decoration: none !important; transition: color .15s; }
#bizsam_footer a:hover { color: #8ee9bb !important; text-decoration: none !important; }

/* ==========================================================================
   Design-review quick wins (2026-07-01)
   ========================================================================== */

/* 1. Sticky footer — pin the JS-injected #bizsam_footer to the viewport bottom
   on short pages (error / thankyou / short forms) instead of letting it float
   up and expose the page background below it. */
body { min-height: 100vh; display: flex; flex-direction: column; }
/* navigation.js sets inline margin:0 on the footer, so !important is required. */
#bizsam_footer { margin-top: auto !important; }
/* biz.css sets height:100% on the shell columns; harmless when body was a
   block (no parent height), but under the flex body it stretches #main_area /
   #right_area to the full viewport and exposes tall empty columns with long
   divider borders (e.g. on /info). Reset to content height. */
#bodis, #body_area, #main_area, #right_area { height: auto; }

/* 2. Leftover teal — biz.css A:link/A:visited + input/textarea borders predate
   the green rebrand. Override to green tokens; A:link is specificity (0,1,1)
   so we must match it with a:link/a:visited (a plain `a` rule loses). */
a:link    { color: var(--c-link); }
a:visited { color: var(--c-link); }
a:link:hover, a:visited:hover { color: var(--c-link-hover); }
input  { border-color: var(--c-border-strong); }
textarea { border-color: var(--c-border-strong) !important; }

/* 3. Force the app font on legacy elements — biz.css body stack
   ('Lucida Grande', Meiryo, Osaka) has no generic fallback and resolves to a
   serif (Times) where those fonts are absent. */
body, table, td, input, textarea, select, button { font-family: var(--c-font); }

/* 4. Larger tap targets for the injected nav/footer links (were 14–22px tall). */
#bizsam_header li { padding-top: 7px !important; padding-bottom: 7px !important; }
#bizsam_footer li { padding-top: 8px !important; padding-bottom: 8px !important; }
#bizsam_header a, #bizsam_footer a { display: inline-block; }
