/* =========================================================
 * tedoriru.css — テドリル 公式デザインシステム
 * Mockup: /html/tedoriru.html ベース。プロジェクト全体で共用。
 * ========================================================= */
:root {
  --navy: #0f1e3d;
  --indigo: #1e3a8a;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --cyan: #06b6d4;
  --bg: #f8f9fc;
  --bg2: #eef1f8;
  --white: #ffffff;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --border: #dde3f0;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(15, 30, 61, 0.08);
  --shadow-lg: 0 8px 40px rgba(15, 30, 61, 0.13);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; }

/* ── HEADER ── */
.site-header {
  background: var(--navy);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--blue);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  font-family: 'DM Mono', monospace;
}
.logo-text { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.logo-sub  { color: var(--cyan); font-size: 11px; font-weight: 300; letter-spacing: 1px; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav a.active { color: var(--cyan); font-weight: 500; }

/* ── 햄버거 메뉴 (모바일) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 10px 8px;
  cursor: pointer;
  margin: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--indigo) 60%, #1d4ed8 100%);
  padding: 52px 24px 48px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 40px,
    rgba(255, 255, 255, .018) 40px, rgba(255, 255, 255, .018) 41px
  );
}
.hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(6, 182, 212, .15);
  border: 1px solid rgba(6, 182, 212, .35);
  color: var(--cyan);
  font-size: 11px; font-weight: 500;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: .8px; margin-bottom: 16px;
}
.hero h1 {
  color: #fff;
  font-size: 34px; font-weight: 700;
  line-height: 1.25; letter-spacing: -1px;
  margin-bottom: 10px;
}
.hero h1 span { color: var(--cyan); }
.hero p {
  color: #94a3b8; font-size: 15px; font-weight: 300;
  max-width: 500px; margin-bottom: 24px;
}
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-num {
  color: #fff; font-size: 22px; font-weight: 700;
  font-family: 'DM Mono', monospace;
}
.hero-stat-label { color: #64748b; font-size: 11px; }

/* ── BREADCRUMB ── */
.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
}
.breadcrumb-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text3);
}
.breadcrumb-inner a { color: var(--blue); text-decoration: none; }
.breadcrumb-inner span { color: var(--text3); }

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

/* ── CALCULATOR CARD ── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.calc-header {
  background: var(--navy);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 12px;
}
.calc-header-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}
.calc-header h2 { color: #fff; font-size: 17px; font-weight: 700; }
.calc-header p  { color: #64748b; font-size: 12px; }

.calc-body { padding: 28px 24px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.form-full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.form-group label .req { color: var(--red); margin-left: 2px; }

.input-wrap { position: relative; }
.input-prefix, .input-suffix {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); font-size: 13px;
  pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }

input[type="number"], input[type="text"], select {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}
input[type="number"].has-prefix { padding-left: 36px; }
input[type="number"].has-suffix { padding-right: 36px; }
select.has-suffix { padding-right: 36px; }

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: #fff;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.slider-group { margin-bottom: 6px; }
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text3);
  margin-top: 6px;
}
input[type="range"] {
  width: 100%; height: 4px;
  border-radius: 2px;
  background: var(--bg2);
  outline: none;
  border: none;
  padding: 0;
  cursor: pointer;
  accent-color: var(--blue);
  margin-top: 8px;
}

.radio-group {
  display: flex;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.radio-group input { display: none; }
.radio-group label {
  flex: 1; text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all .15s;
  margin: 0;
}
.radio-group input:checked + label {
  background: var(--white);
  color: var(--blue);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.calc-btn {
  width: 100%;
  height: 52px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.calc-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
}
.calc-btn:active { transform: translateY(0); }
.calc-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── RESULTS ── */
.result-section {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-main {
  background: linear-gradient(135deg, var(--navy) 0%, var(--indigo) 100%);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.result-main::after {
  content: '¥';
  position: absolute;
  right: -10px; top: -20px;
  font-size: 120px;
  color: rgba(255, 255, 255, .04);
  font-family: 'DM Mono', monospace;
  font-weight: 700;
}
.result-label { color: #64748b; font-size: 12px; letter-spacing: .8px; margin-bottom: 8px; }
.result-amount {
  color: var(--cyan);
  font-size: 48px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  letter-spacing: -2px;
  line-height: 1;
}
.result-amount span { font-size: 20px; color: #94a3b8; margin-left: 4px; }
.result-sub { color: #94a3b8; font-size: 12px; margin-top: 8px; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.result-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.result-item-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.result-item-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.result-item-label.tax::before   { background: var(--orange); }
.result-item-label.ins::before   { background: var(--blue-light); }
.result-item-label.local::before { background: var(--cyan); }
.result-item-label.emp::before   { background: #8b5cf6; }
.result-item-value {
  font-size: 18px; font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text);
}
.result-item-value span { font-size: 12px; font-weight: 400; color: var(--text3); }

.bar-chart { margin-bottom: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { font-size: 11px; color: var(--text2); width: 90px; flex-shrink: 0; text-align: right; }
.bar-track {
  flex: 1; height: 20px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 4px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: #fff;
  transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
  min-width: 32px;
}
.bar-fill.take { background: var(--green); }
.bar-fill.itax { background: var(--orange); }
.bar-fill.ltax { background: var(--cyan); }
.bar-fill.ins  { background: var(--blue-light); }
.bar-fill.emp  { background: #8b5cf6; }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.ad-block {
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.ad-label {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.ad-mock {
  background: var(--bg2);
  border-radius: 8px;
  min-height: 250px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 8px;
  color: var(--text3);
  font-size: 12px;
}
.ad-mock-icon { font-size: 32px; opacity: .4; }

.related-card, .info-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.related-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.related-header h3 { font-size: 13px; font-weight: 700; }
.related-list { padding: 8px 0; }
.related-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--text);
  transition: background .1s;
  border-bottom: 1px solid var(--bg2);
  cursor: pointer;
}
.related-item:hover { background: var(--bg); }
.related-item:last-child { border-bottom: none; }
.related-item-left { display: flex; align-items: center; gap: 10px; }
.related-item-icon {
  width: 30px; height: 30px;
  background: var(--bg2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.related-item-title { font-size: 13px; font-weight: 500; }
.related-item-sub   { font-size: 11px; color: var(--text3); }
.related-arrow      { color: var(--text3); font-size: 12px; }

.info-card { padding: 18px; }
.info-card h3 {
  font-size: 13px; font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.info-card h3::before {
  content: 'ℹ';
  width: 20px; height: 20px;
  background: var(--bg2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--blue);
  flex-shrink: 0;
}
.info-list { list-style: none; }
.info-list li {
  font-size: 12px; color: var(--text2);
  padding: 5px 0;
  border-bottom: 1px solid var(--bg2);
  display: flex; justify-content: space-between;
}
.info-list li:last-child { border-bottom: none; }
.info-list li span { color: var(--text); font-weight: 500; }

/* ── PROGRAMMATIC PAGES SECTION ── */
.pagesec { max-width: 1080px; margin: 0 auto 48px; padding: 0 24px; }
.pagesec-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.pagesec-header h2 { font-size: 18px; font-weight: 700; }
.pagesec-header a  { font-size: 13px; color: var(--blue); text-decoration: none; }

.occ-tabs {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.occ-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  font-family: 'Noto Sans JP', sans-serif;
}
.occ-tab:hover { border-color: var(--blue); color: var(--blue); }
.occ-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 500;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.page-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: block;
}
.page-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(37, 99, 235, .12);
  transform: translateY(-2px);
}
.page-card-title  { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.page-card-amount {
  font-size: 20px; font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--green);
}
.page-card-amount span { font-size: 12px; color: var(--text3); font-family: 'Noto Sans JP'; font-weight: 400; }
.page-card-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── AD BANNER ── */
.ad-banner { max-width: 1080px; margin: 0 auto 32px; padding: 0 24px; }
.ad-banner-inner {
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  text-align: center;
}
.ad-banner-label { font-size: 10px; color: var(--text3); letter-spacing: 1px; margin-bottom: 8px; }
.ad-banner-mock {
  background: var(--bg2);
  min-height: 90px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 12px;
}

/* ── NOTICE ── */
.notice { max-width: 1080px; margin: 0 auto 24px; padding: 0 24px; }
.notice-inner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px; color: #92400e;
}

/* ── ARTICLE / SEO 説明 ── */
.article-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 24px;
}
.article-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.article-card h3 {
  font-size: 14px; font-weight: 700;
  margin-top: 18px; margin-bottom: 8px;
  color: var(--text);
}
.article-card p {
  font-size: 14px; color: var(--text2);
  line-height: 1.8; margin-bottom: 10px;
}
.article-card ul { margin: 8px 0 12px 18px; }
.article-card li { font-size: 14px; color: var(--text2); line-height: 1.8; }
.article-card .faq-q {
  font-weight: 700; color: var(--text);
  margin-top: 14px; margin-bottom: 4px;
}
.article-card .faq-a { color: var(--text2); }

/* ── FOOTER ── */
.site-footer {
  background: var(--navy);
  color: #64748b;
  padding: 40px 24px 24px;
  margin-top: 40px;
}
.footer-inner { max-width: 1080px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand p { font-size: 12px; color: #475569; margin-top: 10px; line-height: 1.7; }
.footer-col h4 {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  transition: color .1s;
}
.footer-col a:hover { color: #94a3b8; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: #475569; text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .main { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .pages-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 26px; }
  .result-amount { font-size: 36px; }

  /* ── 햄버거 + 드롭다운 메뉴 (모바일) ── */
  .site-header { padding: 0 16px; }
  .header-inner { position: relative; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: -16px;
    right: -16px;
    background: var(--navy);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 2px solid var(--blue);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 50;
  }
  .site-nav.open {
    max-height: 420px;
  }
  .site-nav a {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: 14px;
    border-radius: 0;
    text-align: left;
  }
  .site-nav a:last-child { border-bottom: none; }
  .site-nav a:hover { background: rgba(255, 255, 255, .06); }
  .site-nav a.active { background: rgba(37, 99, 235, .18); }

  /* 햄버거 메뉴 열렸을 때 body scroll 잠금 효과 (선택) */
  body.nav-open { overflow: hidden; }
}
