/* ========================================
   役員報酬シミュレーター — style.css
   HIGHDEF INC. Design System
   ======================================== */

:root {
  --hd-navy:       #3D3D6B;
  --hd-navy-light: #52527E;
  --hd-navy-dark:  #2C2C54;
  --hd-accent:     #6C63FF;
  --hd-accent-light: #8B85FF;
  --hd-bg:         #F8F9FC;
  --hd-white:      #FFFFFF;
  --hd-gray-50:    #F1F3F8;
  --hd-gray-100:   #E4E7EF;
  --hd-gray-200:   #C8CDDB;
  --hd-gray-400:   #8B92A8;
  --hd-gray-600:   #5A6178;
  --hd-gray-800:   #2D3142;
  --hd-success:    #10B981;
  --hd-warning:    #F59E0B;
  --hd-red:        #EF4444;
  --hd-font-ja:    'Noto Sans JP', sans-serif;
  --hd-font-num:   'Inter', sans-serif;
  --shadow-sm:     0 1px 3px rgba(61,61,107,0.08);
  --shadow-md:     0 4px 16px rgba(61,61,107,0.1);
  --shadow-lg:     0 8px 32px rgba(61,61,107,0.12);
  --radius:        12px;
  --radius-lg:     16px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--hd-font-ja);
  background: var(--hd-bg);
  color: var(--hd-gray-800);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--hd-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--hd-accent-light);
}

/* ---- Header ---- */
.header {
  background: var(--hd-navy);
  color: var(--hd-white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  color: var(--hd-white);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo:hover {
  color: var(--hd-white);
  opacity: 0.9;
}

.header-badge {
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.header-tools {
  display: flex;
  gap: 16px;
}

.header-sibling-link {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 400;
  transition: color 0.2s;
}
.header-sibling-link:hover {
  color: var(--hd-white);
}

/* ---- Main ---- */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hd-navy);
  line-height: 1.4;
  margin-bottom: 12px;
}

.hero .accent {
  color: var(--hd-accent);
}

.hero p {
  font-size: 0.95rem;
  color: var(--hd-gray-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ---- Card ---- */
.card {
  background: var(--hd-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.card-accent {
  border: 2px solid var(--hd-accent);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hd-navy);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  color: var(--hd-accent);
  flex-shrink: 0;
}

/* ---- Form ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hd-gray-600);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--hd-gray-400);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-unit {
  font-size: 0.8rem;
  color: var(--hd-gray-400);
  white-space: nowrap;
}

input[type="number"],
select {
  font-family: var(--hd-font-num);
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--hd-gray-100);
  border-radius: 8px;
  background: var(--hd-gray-50);
  color: var(--hd-gray-800);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  min-width: 0;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--hd-accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

/* Remove number spinner */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B92A8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ---- Slider ---- */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--hd-accent) 0%, var(--hd-accent) var(--range-pct, 23%), var(--hd-gray-100) var(--range-pct, 23%));
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  margin-top: 8px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hd-accent);
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hd-accent);
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.slider-value-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.slider-value-row .input-with-unit input[type="number"] {
  width: 160px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: right;
}

.slider-annual {
  font-size: 0.9rem;
  color: var(--hd-gray-600);
}

#annualDisplay {
  font-family: var(--hd-font-num);
  font-weight: 600;
  color: var(--hd-navy);
}

/* ---- Optimal Card ---- */
.card-optimal {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: none;
  box-shadow: var(--shadow-md);
}

.optimal-inner {
  text-align: center;
}

.optimal-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hd-gray-800);
  margin-bottom: 8px;
}
.optimal-label svg {
  color: var(--hd-warning);
}

.optimal-value {
  font-family: var(--hd-font-num);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--hd-navy);
  margin-bottom: 4px;
}

.optimal-takehome {
  font-size: 0.95rem;
  color: var(--hd-gray-600);
  margin-bottom: 8px;
}

.optimal-takehome span {
  font-family: var(--hd-font-num);
  font-weight: 600;
  color: var(--hd-success);
}

.optimal-diff {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hd-gray-600);
}
.optimal-diff .diff-positive {
  color: var(--hd-success);
  font-weight: 600;
}
.optimal-diff .diff-negative {
  color: var(--hd-red);
  font-weight: 600;
}

/* ---- Dashboard ---- */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--hd-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
}

.dash-card-primary {
  grid-column: 1 / -1;
  background: var(--hd-navy);
  color: var(--hd-white);
}

.dash-card-primary .dash-label {
  color: rgba(255,255,255,0.7);
}
.dash-card-primary .dash-value {
  color: var(--hd-white);
  font-size: 1.8rem;
}
.dash-card-primary .dash-sub {
  color: rgba(255,255,255,0.6);
}

.dash-card-total {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--hd-navy) 0%, var(--hd-navy-light) 100%);
  color: var(--hd-white);
}
.dash-card-total .dash-label {
  color: rgba(255,255,255,0.7);
}
.dash-card-total .dash-value {
  color: var(--hd-white);
  font-size: 1.5rem;
}
.dash-card-total .dash-sub {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
}

.dash-label {
  font-size: 0.8rem;
  color: var(--hd-gray-400);
  margin-bottom: 4px;
}

.dash-value {
  font-family: var(--hd-font-num);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--hd-navy);
}

.dash-sub {
  font-size: 0.82rem;
  color: var(--hd-gray-400);
  margin-top: 4px;
}
.dash-sub span {
  font-family: var(--hd-font-num);
  font-weight: 600;
}

.dash-breakdown {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--hd-gray-400);
  flex-wrap: wrap;
}
.dash-breakdown span span {
  font-family: var(--hd-font-num);
  font-weight: 500;
  color: var(--hd-gray-600);
}

/* ---- Graph ---- */
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--hd-gray-600);
}

.legend-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}
.legend-takehome { background: var(--hd-success); }
.legend-corp { background: var(--hd-accent); opacity: 0.7; }
.legend-social { background: var(--hd-gray-200); }
.legend-total { background: var(--hd-navy); }

.legend-marker {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hd-red);
}

.graph-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#graph {
  width: 100%;
  height: auto;
  min-height: 280px;
}

/* ---- CTA ---- */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--hd-navy) 0%, var(--hd-navy-light) 100%);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin: 32px 0;
  color: var(--hd-white);
}

.cta-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.cta-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.8;
  margin-bottom: 24px;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cta-btn-primary {
  background: var(--hd-accent);
  color: var(--hd-white);
}
.cta-btn-primary:hover {
  color: var(--hd-white);
  background: var(--hd-accent-light);
}

.cta-btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--hd-white);
  border: 1px solid rgba(255,255,255,0.25);
}
.cta-btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  color: var(--hd-white);
}

/* ---- Footer ---- */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  font-size: 0.82rem;
  color: var(--hd-gray-400);
}

.footer-disclaimer {
  background: var(--hd-gray-50);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 0.78rem;
  color: var(--hd-gray-600);
}

.footer-article {
  margin-bottom: 10px;
}

.footer-article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hd-gray-600);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-article a:hover {
  color: var(--hd-accent);
}
.footer-article a svg {
  flex-shrink: 0;
}

.footer-copy {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hd-gray-100);
  font-size: 0.78rem;
}
.footer-copy a {
  color: var(--hd-gray-600);
}
.footer-copy a:hover {
  color: var(--hd-accent);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
    height: 50px;
  }
  .header-logo {
    font-size: 1rem;
  }
  .header-badge {
    font-size: 0.6rem;
    padding: 1px 6px;
  }
  .header-tools {
    gap: 10px;
  }
  .header-sibling-link {
    font-size: 0.7rem;
  }

  .main {
    padding: 0 16px 32px;
  }

  .hero {
    padding: 32px 0 24px;
  }
  .hero h1 {
    font-size: 1.35rem;
  }
  .hero p {
    font-size: 0.85rem;
  }

  .card {
    padding: 20px 18px;
    border-radius: var(--radius);
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .slider-value-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .slider-value-row .input-with-unit input[type="number"] {
    width: 140px;
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dash-card-primary,
  .dash-card-total {
    grid-column: 1;
  }
  .dash-card-primary .dash-value {
    font-size: 1.5rem;
  }

  .graph-legend {
    gap: 10px;
  }

  .cta-section {
    padding: 28px 20px;
  }
  .cta-title {
    font-size: 1rem;
  }
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .cta-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .footer {
    padding: 24px 16px 40px;
  }
}
