/* ============================================================
   HIGHDEF Total Personnel Cost Simulator - Stylesheet
   © 2025 株式会社ハイデフ - All Rights Reserved
   ============================================================ */

: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;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--hd-font-ja);
  background: var(--hd-bg);
  color: var(--hd-gray-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* === Header === */
.header {
  background: var(--hd-navy);
  padding: 16px 0;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  color: var(--hd-white);
  font-family: var(--hd-font-num);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 3px;
  text-decoration: none;
}
.header-badge {
  font-size: 11px;
  color: var(--hd-gray-200);
  font-weight: 400;
  letter-spacing: 0;
  display: block;
  margin-top: 2px;
}
.header-year {
  color: var(--hd-gray-200);
  font-size: 12px;
  font-weight: 400;
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--hd-navy) 0%, var(--hd-navy-light) 100%);
  padding: 48px 24px 56px;
  text-align: center;
}
.hero h1 {
  color: var(--hd-white);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}
.hero h1 .accent {
  color: var(--hd-accent-light);
}
.hero p {
  color: var(--hd-gray-200);
  font-size: 15px;
  font-weight: 300;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.8;
}

/* === Main === */
.main {
  max-width: 960px;
  margin: -32px auto 0;
  padding: 0 24px 60px;
  position: relative;
  z-index: 1;
}

/* === Card === */
.card {
  background: var(--hd-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--hd-navy);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon {
  width: 20px;
  height: 20px;
  color: var(--hd-accent);
}

/* === Form === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--hd-gray-600);
}
.form-label .required {
  color: var(--hd-red);
  font-size: 11px;
  margin-left: 4px;
}
.form-input, .form-select {
  font-family: var(--hd-font-ja);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--hd-gray-100);
  border-radius: 8px;
  background: var(--hd-white);
  color: var(--hd-gray-800);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus {
  border-color: var(--hd-accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}
.form-input::placeholder { color: var(--hd-gray-200); }
.form-hint {
  font-size: 12px;
  color: var(--hd-gray-400);
  margin-top: 2px;
}

.input-with-unit {
  position: relative;
}
.input-with-unit .form-input {
  padding-right: 40px;
}
.input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--hd-gray-400);
  pointer-events: none;
}

/* === Button === */
.calc-btn {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 28px;
  background: var(--hd-navy);
  color: var(--hd-white);
  font-family: var(--hd-font-ja);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
  letter-spacing: 1px;
}
.calc-btn:hover { background: var(--hd-navy-light); }
.calc-btn:focus-visible { outline: 3px solid var(--hd-accent); outline-offset: 2px; }
.calc-btn:active { transform: scale(0.99); }

/* === Result === */
.result-section { display: none; }
.result-section.visible { display: block; }

.result-hero-card {
  background: linear-gradient(135deg, var(--hd-navy) 0%, var(--hd-accent) 100%);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  color: var(--hd-white);
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.result-hero-label {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.85;
  margin-bottom: 8px;
}
.result-hero-value {
  font-family: var(--hd-font-num);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
}
.result-hero-sub {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 12px;
  line-height: 1.6;
}
.result-hero-diff {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
}

/* === Breakdown Grid === */
.result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.breakdown-item {
  background: var(--hd-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--hd-gray-100);
}
.breakdown-item.highlight {
  border-left-color: var(--hd-accent);
}
.breakdown-label {
  font-size: 12px;
  color: var(--hd-gray-400);
  margin-bottom: 6px;
  font-weight: 500;
}
.breakdown-value {
  font-family: var(--hd-font-num);
  font-size: 20px;
  font-weight: 600;
  color: var(--hd-gray-800);
}
.breakdown-rate {
  font-size: 11px;
  color: var(--hd-gray-400);
  margin-top: 4px;
  font-family: var(--hd-font-num);
}

/* === Detail Table === */
.result-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.result-detail-table th {
  text-align: left;
  font-weight: 500;
  color: var(--hd-gray-400);
  font-size: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hd-gray-50);
}
.result-detail-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--hd-gray-50);
}
.result-detail-table td:last-child {
  text-align: right;
  font-family: var(--hd-font-num);
  font-weight: 500;
}
.result-detail-table tr:last-child td,
.result-detail-table tr:last-child th { border-bottom: none; }
.result-detail-table .total-row td {
  font-weight: 700;
  font-size: 16px;
  color: var(--hd-navy);
  padding-top: 14px;
  border-top: 2px solid var(--hd-navy);
  border-bottom: none;
}

/* === Monthly Bar === */
.monthly-bar {
  margin-top: 20px;
}
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--hd-gray-600);
  min-width: 120px;
}
.bar-track {
  flex: 1;
  height: 28px;
  background: var(--hd-gray-50);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.bar-fill-salary {
  background: var(--hd-gray-200);
}
.bar-fill-total {
  background: linear-gradient(90deg, var(--hd-navy), var(--hd-accent));
}
.bar-amount {
  font-family: var(--hd-font-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--hd-white);
  white-space: nowrap;
}
.bar-amount-outside {
  font-family: var(--hd-font-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--hd-gray-600);
  margin-left: 8px;
  white-space: nowrap;
}

/* === CTA === */
.cta-section {
  background: var(--hd-gray-50);
  border: 1.5px solid var(--hd-gray-100);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 32px;
}
.cta-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--hd-navy);
  margin-bottom: 10px;
}
.cta-desc {
  font-size: 14px;
  color: var(--hd-gray-600);
  margin-bottom: 20px;
  line-height: 1.8;
}
.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-family: var(--hd-font-ja);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.cta-btn-primary {
  background: var(--hd-navy);
  color: var(--hd-white);
}
.cta-btn-primary:hover { background: var(--hd-navy-light); }
.cta-btn-primary:focus-visible, .cta-btn-secondary:focus-visible { outline: 3px solid var(--hd-accent); outline-offset: 2px; }
.cta-btn-secondary {
  background: var(--hd-white);
  color: var(--hd-navy);
  border: 1.5px solid var(--hd-gray-200);
}
.cta-btn-secondary:hover { border-color: var(--hd-navy); }

/* === Footer === */
.footer {
  background: var(--hd-navy-dark);
  color: var(--hd-gray-200);
  padding: 32px 24px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}
.footer a {
  color: var(--hd-accent-light);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }
.footer-disclaimer {
  max-width: 640px;
  margin: 0 auto 16px;
  color: var(--hd-gray-400);
  font-size: 11px;
  line-height: 1.8;
}
.footer-article {
  margin: 0 auto 16px;
  font-size: 12px;
}
.footer-article a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hd-gray-200);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.footer-article a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* === Share / Reset === */
.share-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: transparent;
  color: var(--hd-white);
  font-family: var(--hd-font-ja);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.share-btn:hover { background: rgba(255,255,255,0.1); }
.share-btn:focus-visible { outline: 2px solid var(--hd-white); outline-offset: 2px; }

.reset-row {
  text-align: center;
  margin-top: 16px;
}
.reset-btn {
  background: none;
  border: none;
  color: var(--hd-gray-400);
  font-family: var(--hd-font-ja);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px 16px;
}
.reset-btn:hover { color: var(--hd-gray-600); }

/* === Responsive === */
@media (max-width: 640px) {
  .hero { padding: 36px 20px 44px; }
  .hero h1 { font-size: 22px; }
  .main { padding: 0 16px 40px; }
  .card { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .result-hero-value { font-size: 32px; }
  .result-breakdown { grid-template-columns: 1fr; }
  .breakdown-value { font-size: 18px; }
  .cta-buttons { flex-direction: column; }
  .bar-label { min-width: 80px; font-size: 12px; }
}

/* === Animation === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-section.visible {
  animation: fadeInUp 0.4s ease;
}
