@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* =========================
   CSS Variables
   ========================= */
:root {
  /* Colors */
  --c-cyan: hsl(188, 78%, 50%);
  --c-cyan-600: hsl(188, 82%, 42%);
  --c-cyan-700: hsl(188, 86%, 36%);
  --c-bg: #fafbfc;
  --c-surface: #ffffff;
  --c-surface-elevated: #ffffff;
  --c-text: #1a202c;
  --c-text-muted: #64748b;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-white: #ffffff;

  /* Layout */
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 10px 15px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 20px 25px rgba(0,0,0,.12);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 25px 50px rgba(0,0,0,.15);
  --container-width: 1200px;
  --section-padding: 4rem 0;

  /* Typography */
  --font-system: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
}

/* =========================
   Reset & Base
   ========================= */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family:var(--font-system);
  background-color:var(--c-bg);
  color:var(--c-text);
  line-height:1.6;
  font-size:var(--text-base);
}
.container { max-width:var(--container-width); margin:0 auto; padding:0 1rem; }
.section { padding:var(--section-padding); }
.section-title {
  font-size:var(--text-3xl); font-weight:700; text-align:center; margin-bottom:3rem; color:var(--c-text);
}
a { color:inherit; }

/* Focus */
:where(a,button,input,select,summary).focus-visible,
:where(a,button,input,select,summary):focus-visible {
  outline:3px solid rgba(34,139,230,.3); outline-offset:2px; border-radius:8px;
}

/* =========================
   Header
   ========================= */
.header {
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--c-border-light);
  position:sticky; top:0; z-index:100;
}
.header .container { display:flex; justify-content:space-between; align-items:center; padding:1rem; }
.header-brand h1 { font-size:var(--text-2xl); font-weight:700; color:var(--c-cyan); margin:0; }
.brand-sub { font-size:var(--text-sm); color:var(--c-text-muted); }
.header-nav { display:flex; gap:2rem; }
.nav-link { color:var(--c-text); text-decoration:none; font-weight:500; transition:color .3s; }
.nav-link:hover { color:var(--c-cyan); }
.mobile-menu-btn { display:none; flex-direction:column; background:none; border:0; cursor:pointer; padding:.5rem; }
.mobile-menu-btn span { width:25px; height:3px; background-color:var(--c-text); margin:2px 0; transition:.3s; }
.mobile-menu { display:none; flex-direction:column; background:var(--c-white); border-top:1px solid var(--c-border); padding:1rem; }
.mobile-nav-link { color:var(--c-text); text-decoration:none; padding:.75rem 0; border-bottom:1px solid var(--c-border-light); font-weight:500; }
.mobile-nav-link:hover { color:var(--c-cyan); }

/* ===== Header horizontal layout (PC) ===== */
.header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:2rem;
  padding:1rem;
}
.brand-link { display:flex; flex-direction:column; text-decoration:none; }
.brand-title { margin:0; line-height:1.1; color:var(--c-cyan); }
.brand-sub { margin-top:.25rem; font-size:var(--text-sm); color:var(--c-text-muted); }
.header-nav { margin-left:auto; }
.nav-list {
  display:flex;
  align-items:center;
  gap:2rem;
  list-style:none;
  margin:0;
  padding:0;
}
.nav-link { text-decoration:none; color:var(--c-text); font-weight:600; }
.nav-link:hover { color:var(--c-cyan); }
@media (max-width:768px){
  .header-nav{ display:none; }
}

/* =========================
   Buttons
   ========================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:.75rem 1.5rem; border:none; border-radius:var(--radius);
  font-size:var(--text-base); font-weight:600; text-decoration:none; cursor:pointer;
  transition:all .3s; white-space:nowrap;
}
.btn-primary{ background:var(--c-cyan); color:var(--c-white); box-shadow:var(--shadow-md); border:1px solid transparent; }
.btn-primary:hover{ background:var(--c-cyan-600); transform:translateY(-1px); box-shadow:var(--shadow-lg); }
.btn-ghost{ background:var(--c-white); color:var(--c-cyan); border:1px solid var(--c-border); box-shadow:var(--shadow); }
.btn-ghost:hover{ background:var(--c-cyan); color:var(--c-white); border-color:var(--c-cyan); transform:translateY(-1px); box-shadow:var(--shadow-md); }

/* =========================
   Hero
   ========================= */
.hero{ background:linear-gradient(135deg,#f8fafc 0%,#e2e8f0 100%); padding:5rem 0; }
.key-points{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:2rem; margin-bottom:4rem; }
.key-point{ background:var(--c-white); border:1px solid var(--c-border-light); border-radius:var(--radius-lg); padding:2rem; text-align:center; box-shadow:var(--shadow); transition:all .3s; }
.key-point:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.key-point-icon{ font-size:60px; margin-bottom:1rem; } /* ← typo修正 */
.key-point h3{ font-size:var(--text-xl); margin-bottom:.5rem; color:var(--c-cyan); }
.hero-content{ display:grid; grid-template-columns:1fr 1fr; gap:4rem; align-items:center; }
.hero-title{
  font-size:var(--text-4xl); font-weight:800; margin-bottom:1rem;
  background:linear-gradient(135deg,var(--c-text),var(--c-cyan));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.hero-subtitle{ font-size:var(--text-xl); color:var(--c-cyan); font-weight:600; margin-bottom:1.5rem; }
.hero-description{ font-size:var(--text-lg); color:var(--c-text-muted); margin-bottom:2rem; line-height:1.7; }
.hero-actions{ display:flex; gap:1rem; flex-wrap:wrap; }
.hero-mockup{ width:100%; border-radius:var(--radius-lg); display:flex; align-items:center; justify-content:center; }
.hero-penlight { display:block; max-width:100%; height:auto; margin:0 auto 16px; border-radius:8px; }
.mockup-content{text-align:center}
.mockup-icon{font-size:4rem;margin-bottom:1rem}
.mockup-content p{font-size:var(--text-lg);font-weight:600;color:var(--c-cyan);margin-bottom:.5rem}
.mockup-content span{font-size:var(--text-sm);color:var(--c-text-muted)}

/* =========================
   Features
   ========================= */
.features{ background:var(--c-bg); }
.features-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:2rem; }
.feature-card{ background:var(--c-white); border:1px solid var(--c-border-light); border-radius:var(--radius-lg); padding:2rem; box-shadow:var(--shadow); transition:all .3s; }
.feature-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--c-border); }
.feature-icon{ font-size:var(--text-3xl); margin-bottom:1rem; }
.feature-card h3{ font-size:var(--text-xl); margin-bottom:1rem; color:var(--c-cyan); }
.feature-image img { width:100%; height:auto; margin:0 auto 16px; border-radius:8px; }

/* =========================
   Products
   ========================= */
.products { background: var(--c-white); }
/* 基本：スマホ2列 */
.products-grid{
  display:grid;
  gap:2rem;
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
/* PC：3列固定（1024px以上） */
@media (min-width:1024px){
  .products-grid{ grid-template-columns:repeat(3, 1fr); }
}
.product-card{ background:var(--c-white); border:1px solid var(--c-border-light); border-radius:var(--radius-lg); box-shadow:var(--shadow); overflow:hidden; transition:all .3s; }
.product-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.product-image img{ width:100%; height:100%; object-fit:contain; }
.product-image-content{ text-align:center; }
.product-content{ padding:1.5rem; }
.product-header{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:1rem; }
.product-name{ font-size:var(--text-2xl); font-weight:700; color:var(--c-cyan); }
.product-footer{ display:flex; justify-content:space-between; align-items:center; }

/* =========================
   Pricing Calculator
   ========================= */
.pricing{ background:var(--c-bg); }
.pricing-calculator{
  background:var(--c-white); border-radius:var(--radius-lg); box-shadow:var(--shadow-md);
  overflow:hidden; border:1px solid var(--c-border-light); max-width:1000px; margin:0 auto;
}
.calculator-section{ padding:2rem; border-bottom:1px solid var(--c-border); }
.calculator-section:last-child{ border-bottom:none; }
.calculator-section h3{ font-size:var(--text-xl); margin-bottom:1.5rem; color:var(--c-cyan); }
.product-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:1rem; }
.product-selection-card{ background:var(--c-bg); border:2px solid var(--c-border); border-radius:var(--radius); padding:1.5rem; cursor:pointer; transition:all .3s ease; text-align:left; }
.product-selection-card:hover{ border-color:var(--c-cyan); box-shadow:var(--shadow-md); transform:translateY(-1px); }
.product-selection-card.selected{ border-color:var(--c-cyan); box-shadow:0 0 0 2px rgba(34,139,230,.1); background:rgba(34,139,230,.02); }
.product-selection-card h4{ color:var(--c-cyan); margin-bottom:.5rem; }
.product-selection-price{ font-size:var(--text-2xl); font-weight:700; color:var(--c-text); margin-bottom:1rem; }
.product-selection-specs{ font-size:var(--text-sm); color:var(--c-text-muted); line-height:1.4; }
.product-selection-specs div{ margin-bottom:.25rem; }

.calculator-inputs{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; }
.input-group{ display:flex; flex-direction:column; gap:.5rem; position:relative; }
.input-group label{ font-weight:600; color:var(--c-text); }
.input-group input, .input-group select{
  padding:.75rem; border:1px solid var(--c-border); border-radius:var(--radius);
  background:var(--c-white); color:var(--c-text); font-size:var(--text-base); transition:all .2s ease;
}
.input-group input:focus, .input-group select:focus{ outline:none; border-color:var(--c-cyan); box-shadow:0 0 0 3px rgba(34,139,230,.1); transform:translateY(-1px); }
.input-unit{ position:absolute; right:.75rem; top:50%; transform:translateY(-50%); color:var(--c-text-muted); pointer-events:none; }
.checkbox-group{ flex-direction:row; align-items:center; gap:.75rem; }
.checkbox-group input[type="checkbox"]{ width:auto; margin:0; }

/* =========================
   Quote Summary
   ========================= */
.quote-summary{ background:var(--c-bg); padding: 2rem; }
.quote-details{ margin-bottom:2rem; }
.quote-row{ display:flex; justify-content:space-between; align-items:center; padding:.75rem 0; border-bottom:1px solid var(--c-border); }
.quote-row.total{
  font-size:var(--text-xl); font-weight:700; color:var(--c-cyan);
  border-bottom:2px solid var(--c-cyan); background:rgba(34,139,230,.02);
  padding:1rem 0;  margin-top:.5rem;
}
.quote-actions{ display:flex; gap:1rem; flex-wrap:wrap; }

/* =========================
   Timeline / FAQ / Contact / Footer
   ========================= */
.timeline{ background:var(--c-white); }
.timeline-container{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:2rem; }
.timeline-item{ display:flex; flex-direction:column; align-items:center; text-align:center; background:var(--c-white); border:1px solid var(--c-border-light); border-radius:var(--radius-lg); padding:2rem; box-shadow:var(--shadow); transition:all .3s; }
.timeline-item:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.timeline-icon{ background:var(--c-cyan); color:var(--c-white); width:4rem; height:4rem; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:var(--text-xl); font-weight:700; margin-bottom:1rem; box-shadow:var(--shadow-lg); }
.timeline-item h3{ font-size:var(--text-lg); font-weight:600; margin-bottom:.5rem; }
.timeline-item p{ color:var(--c-text-muted); font-size:var(--text-sm); margin-bottom:1rem; }
.timeline-duration{ background:rgba(34,139,230,.1); color:var(--c-cyan); padding:.5rem 1rem; border-radius:var(--radius); font-size:var(--text-sm); font-weight:500; }

.faq{ background:var(--c-bg); }
.faq-list{ max-width:800px; margin:0 auto; }
.faq-item{ background:var(--c-white); border:1px solid var(--c-border); border-radius:var(--radius); margin-bottom:1rem; box-shadow:var(--shadow); }
.faq-item summary{ padding:1.5rem; cursor:pointer; font-weight:600; list-style:none; position:relative; }
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{ content:'+'; position:absolute; right:1.5rem; top:50%; transform:translateY(-50%); font-size:var(--text-xl); color:var(--c-cyan); }
.faq-item[open] summary::after{ content:'-'; }
.faq-item p{ padding:0 1.5rem 1.5rem; color:var(--c-text-muted); line-height:1.6; }

.contact{ background:var(--c-white); }
.contact-content{ max-width:600px; margin:0 auto; text-align:center; }
.contact-description{ font-size:var(--text-lg); color:var(--c-text-muted); margin-bottom:2rem; line-height:1.6; }
.contact-methods{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:2rem; }
.contact-method{ background:var(--c-bg); border:1px solid var(--c-border); border-radius:var(--radius); padding:2rem; text-align:center; }
.contact-icon{ font-size:2rem; margin-bottom:1rem; }
.contact-method h3{ font-weight:600; margin-bottom:.5rem; }
.contact-method p{ color:var(--c-text-muted); }

.footer{ background:var(--c-text); color:var(--c-white); padding:3rem 0 1rem; }
.footer-content{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:2rem; margin-bottom:2rem; }
.footer-section h3{ color:var(--c-cyan); margin-bottom:1rem; }
.footer-section h4{ margin-bottom:1rem; }
.footer-section ul{ list-style:none; }
.footer-section ul li{ margin-bottom:.5rem; opacity:.8; }
.footer-section p{ opacity:.8; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.2); padding-top:1rem; text-align:center; opacity:.6; }

/* =========================
   Modal
   ========================= */
.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:2000; /* 重ね順強化 */
  background-color:rgba(0,0,0,.5);
  align-items:center;
  justify-content:center;
}
.modal.show,
.modal[aria-hidden="false"]{
  display:flex !important; /* JSのどちらの制御でも表示 */
}
.modal-content{
  background:var(--c-white);
  padding:0;
  border-radius:var(--radius-lg);
  width:90%;
  max-width:800px;
  max-height:80vh;
  overflow:auto;
  box-shadow:var(--shadow-xl);
}
.modal-header{
  background:var(--c-bg);
  padding:1.5rem;
  border-bottom:1px solid var(--c-border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  position:sticky;
  top:0;
  z-index:1;
}
.modal-header h3{ margin:0; color:var(--c-cyan); }
.close{ color:var(--c-text-muted); font-size:28px; font-weight:bold; cursor:pointer; }
.close:hover{ color:var(--c-text); }
.modal-body{ padding:2rem; }
body.modal-open{ overflow:hidden; }

/* =========================
   Quote Document (in modal)
   ========================= */
.quote-document{ background:#fff; }
.quote-header{ display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--c-border); padding-bottom:1rem; margin-bottom:2rem; }
.quote-header h2{ margin:0; }
.quote-meta{ font-size:var(--text-sm); color:var(--c-text-muted); text-align:right; }
.quote-parties{ display:grid; grid-template-columns:1fr 1fr; gap:2rem; margin-bottom:2rem; }
.quote-client .client-info p,
.quote-issuer .issuer-info p{ margin:.1rem 0; }
.summary-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:1rem; font-size:var(--text-sm); }
.quote-table{ width:100%; border-collapse:collapse; border:1px solid var(--c-border); border-radius:var(--radius); overflow:hidden; }
.quote-table thead{ background:var(--c-bg); }
.quote-table th, .quote-table td{ padding:1rem; border-top:1px solid var(--c-border); }
.quote-table .ta-r{ text-align:right; }
.quote-table .strong{ font-weight:700; }
.quote-table .small{ font-size:var(--text-sm); color:var(--c-text-muted); }
.quote-total{ font-size:var(--text-2xl); font-weight:700; color:var(--c-cyan); text-align:right; margin:1.25rem 0 2rem; }
.quote-notes{ background:var(--c-bg); padding:1rem; border-radius:var(--radius); margin-bottom:2rem; }
.quote-actions{ display:flex; gap:.75rem; justify-content:flex-end; }

/* Quote form utilities */
.grid{ display:grid; gap:1rem; }
.grid-2{ grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); }
.col-span-2{ grid-column:1 / -1; }
.form-label{ display:block; margin-bottom:.5rem; font-weight:600; }
.form-input{ width:100%; padding:.75rem; border:1px solid var(--c-border); border-radius:var(--radius); }
.form-input:focus{ outline:none; border-color:var(--c-cyan); box-shadow:0 0 0 3px rgba(34,139,230,.1); }
.align-right{ text-align:right; }

/* =========================
   Fixed CTA（新UI）
   ========================= */
.pen-fixed-cta {
  position:fixed;
  bottom:0; left:0; right:0;
  z-index:900;
  background:var(--c-white);
  border-top:1px solid var(--c-border);
  box-shadow:0 -6px 20px rgba(0,0,0,.06);
}
.pen-fixed-cta__inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1rem .75rem;
  max-width:var(--container-width);
  margin:0 auto;
}
.pen-fixed-cta__metrics { display:grid; grid-auto-flow:column; gap:2.25rem; align-items:end; }
.pen-metric { display:grid; gap:.25rem; }
.pen-metric__label { font-size:var(--text-sm); color:var(--c-text-muted); letter-spacing:.02em; }
.pen-metric__value { font-weight:800; font-size:clamp(1rem, 1.4vw + .6rem, 1.7rem); color:var(--c-text); white-space:nowrap; }
.pen-metric__value--accent { color:var(--c-cyan); }
.pen-fixed-cta__button { min-width:220px; padding:.9rem 1.5rem; font-size:var(--text-lg); border-radius:var(--radius-lg); }

/* responsive */
@media (max-width: 768px) {
  .pen-fixed-cta__inner { padding:.75rem .5rem; gap:.5rem; }
  .pen-fixed-cta__metrics { gap:1rem; }
  .pen-fixed-cta__button { min-width:180px; font-size:var(--text-base); padding:.8rem 1.1rem; }
}
@media (max-width: 420px) {
  .pen-metric__label { font-size:12px; }
  .pen-metric__value { font-size:1.05rem; }
  .pen-fixed-cta__button { min-width:160px; }
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px){
  .header-brand h1{ font-size:1.25rem; }
}
@media (max-width: 768px){
  .header-nav{ display:none; }
  .mobile-menu-btn{ display:flex; }
  .mobile-menu.active{ display:flex; }

  .hero-content{ grid-template-columns:1fr; gap:2rem; }
  .hero-title{ font-size:var(--text-3xl); }
  .hero-actions{ justify-content:center; }
  .key-points{ grid-template-columns:1fr; }
  .features-grid{ grid-template-columns:1fr; }
  .products-grid{ grid-template-columns:1fr; }
  .calculator-inputs{ grid-template-columns:1fr; }
  .timeline-container{ grid-template-columns:1fr; }
  .contact-methods{ grid-template-columns:1fr; }
  .footer-content{ grid-template-columns:1fr; text-align:center; }
  .modal-content{ width:95%; margin:2% auto; }
}

/* 画面では印刷用DOMを非表示にしておく */
#printArea { display: none; }


/* ===== 印刷：#printArea だけを 1 枚で出力 ===== */
@media print {
  /* まず全て消す（表示/可視を両方オフにして既存ルールを無力化） */
  html, body { background:#fff !important; }
  body * {
    display: none !important;
    visibility: hidden !important;
  }

  /* 印刷領域だけ可視化（display を「revert」で元の既定表示に戻す） */
  #printArea,
  #printArea * {
    display: revert !important;     /* Chrome/Edge/Safari/Firefox 対応 */
    visibility: visible !important;
  }

  /* テーブル要素は UA 既定レイアウトを強制 */
  #printArea table  { display: table !important; border-collapse: collapse !important; }
  #printArea thead  { display: table-header-group !important; }
  #printArea tbody  { display: table-row-group !important; }
  #printArea tr     { display: table-row !important; }
  #printArea th,
  #printArea td     { display: table-cell !important; }

  /* ページ設定と配色保持 */
  @page { size: A4; margin: 12mm; }
  #printArea .quote-document {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    box-shadow: none !important;
    border: none !important;
  }
  /* 印刷時も必ず横並びに（他のメディアクエリを無効化） */
  #printArea .quote-parties{
    grid-template-columns:1fr 1fr !important;
    gap:2rem !important;
  }
  #printArea .quote-actions{ display:none !important; } 
}
