/* ============================================================
   育児休業給付金計算ツール — style.css
   Primary: #be185d (rose/pink)
   ============================================================ */

:root {
  --primary: #be185d;
  --primary-hover: #9d174d;
  --primary-rgb: 190, 24, 93;
  --primary-light: #fce7f3;
  --primary-lighter: #fdf2f8;
  --bg: #f9f7f4;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-weak: #9ca3af;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --transition: 0.15s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'BIZ UDPGothic', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  word-break: break-word;
}

/* ============================================================
   Header
   ============================================================ */

header {
  background: linear-gradient(135deg, var(--primary) 0%, #db2777 100%);
  color: #fff;
  padding: 2rem 1.25rem 1.75rem;
  text-align: center;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
}

.header-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

header h1 {
  font-family: 'Outfit', 'BIZ UDPGothic', sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.header-sub {
  font-size: 0.9rem;
  opacity: 0.88;
  margin-top: 0.5rem;
}

/* ============================================================
   Main layout
   ============================================================ */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

@media (min-width: 640px) {
  main {
    padding: 1.5rem 1.5rem 4rem;
  }
}

/* ============================================================
   Ad unit placeholder
   ============================================================ */

.ad-unit {
  min-height: 0;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-weak);
  font-size: 0.75rem;
}

/* ============================================================
   Privacy notice
   ============================================================ */

.privacy-notice {
  background: var(--primary-lighter);
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  color: #9d174d;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.privacy-notice i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ============================================================
   Card
   ============================================================ */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  transition: box-shadow var(--transition), transform var(--transition);
  margin-bottom: 1.25rem;
}

/* ============================================================
   Input card / Form
   ============================================================ */

.input-card {
  background: var(--surface);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.form-label i {
  color: var(--primary);
  font-size: 0.9rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.input-with-unit {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

.input-with-unit .form-input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
}

.input-unit {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

select.form-input {
  cursor: pointer;
  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='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  background: var(--primary-lighter);
  border-radius: var(--radius-sm);
  border: 1px solid #fbcfe8;
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.toggle-label i {
  color: var(--primary);
}

.toggle-note {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 100px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 4px;
  left: 4px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

/* Reform info note */
.reform-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fce7f3;
  border: 1px solid #f9a8d4;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #9d174d;
  margin-bottom: 1.25rem;
}

.reform-info i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Calc button */
.btn-calc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform 0.12s ease, box-shadow var(--transition);
  min-height: 52px;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
  margin-top: 0.5rem;
}

.btn-calc:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.40);
}

.btn-calc:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================================
   Results area
   ============================================================ */

.results-area {
  margin-top: 0.5rem;
}

/* Summary card */
.summary-card {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid #fbcfe8;
}

.summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-grid .summary-item:last-child {
    grid-column: span 2;
  }
}

.summary-item {
  text-align: center;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  padding: 0.875rem 0.5rem;
  border: 1px solid rgba(190, 24, 93, 0.12);
}

.summary-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.summary-value.accent {
  color: #db2777;
}

.summary-value.highlight {
  color: #9d174d;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.summary-note {
  font-size: 0.8125rem;
  color: #9d174d;
  background: rgba(255,255,255,0.8);
  border: 1px solid #f9a8d4;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Chart card */
.chart-card {}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-title i {
  color: var(--primary);
}

.chart-wrapper {
  position: relative;
  height: 260px;
}

@media (min-width: 640px) {
  .chart-wrapper {
    height: 300px;
  }
}

.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-benefit { background: var(--primary); }
.dot-exempt { background: #f9a8d4; }
.dot-total { background: #9d174d; }

/* Table card */
.table-card {}

.table-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-title i {
  color: var(--primary);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
}

.monthly-table th {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 700;
  padding: 0.625rem 0.75rem;
  text-align: right;
  border-bottom: 2px solid #fbcfe8;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.monthly-table th:first-child {
  text-align: left;
}

.monthly-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}

.monthly-table td:first-child {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.monthly-table tbody tr:last-child td {
  border-bottom: none;
}

.monthly-table tbody tr:hover td {
  background: var(--primary-lighter);
}

.monthly-table .rate-high {
  color: var(--primary);
  font-weight: 700;
}

.monthly-table .rate-low {
  color: var(--text-muted);
}

.monthly-table .total-col {
  font-weight: 700;
  color: #9d174d;
}

.monthly-table .reform-row td {
  background: #fdf2f8;
}

/* Note card */
.note-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.calc-note {
  font-size: 0.8125rem;
  color: #92400e;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.6;
}

.calc-note i {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: #d97706;
}

/* ============================================================
   Howto / SEO section
   ============================================================ */

.howto-section {
  margin-top: 0.5rem;
}

.howto-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

.howto-section p {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 0.875rem;
  max-width: 65ch;
}

.howto-steps {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
}

.howto-steps li {
  counter-increment: step-counter;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.75rem 0;
  font-size: 0.9375rem;
  color: #374151;
  border-bottom: 1px solid var(--border);
}

.howto-steps li:last-child {
  border-bottom: none;
}

.howto-steps li::before {
  content: counter(step-counter);
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Accordion */
.accordion-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.accordion-howto {
  margin-top: 0.5rem;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  transition: background var(--transition);
  min-height: 44px;
  gap: 0.5rem;
}

.accordion-summary::-webkit-details-marker { display: none; }

.accordion-summary:hover {
  background: var(--primary-lighter);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition), transform var(--transition);
}

.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition);
}

.accordion-icon::before {
  width: 10px;
  height: 1.5px;
}

.accordion-icon::after {
  width: 1.5px;
  height: 10px;
}

details[open] .accordion-icon::after {
  transform: scaleY(0);
}

.accordion-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.75;
}

.accordion-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.accordion-body table th {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #fbcfe8;
}

.accordion-body table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.accordion-body ul, .accordion-body ol {
  padding-left: 1.25rem;
}

.accordion-body li {
  margin-bottom: 0.375rem;
}

.accordion-body dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.accordion-body dt {
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.875rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.accordion-body dt:first-child {
  margin-top: 0;
}

.accordion-body dd {
  margin: 0.25rem 0 0.5rem 1.375rem;
  font-size: 0.875rem;
  color: #4b5563;
}

.ref-links {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.ref-links li {
  margin-bottom: 0.375rem;
}

.ref-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
}

.ref-links a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.ref-links a::after {
  content: ' \2197';
  font-size: 0.75em;
}

.disclaimer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border: 1px solid var(--border);
  line-height: 1.65;
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

footer p + p {
  margin-top: 0.5rem;
}

/* ============================================================
   Utilities
   ============================================================ */

[hidden] {
  display: none !important;
}
