/* ============================================
   副業・兼業 手取りシミュレーター — style.css
   ============================================ */

:root {
  --primary: #b45309;
  --primary-hover: #92400e;
  --primary-light: #fef3c7;
  --primary-rgb: 180, 83, 9;
  --accent: #d97706;
  --accent-rgb: 217, 119, 6;
  --bg: #f9f7f4;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1a1a2e;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --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;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
}

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

html {
  scroll-behavior: smooth;
}

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

/* ============ Header ============ */
header {
  background: linear-gradient(135deg, #78350f 0%, #92400e 60%, #b45309 100%);
  color: #fff;
  padding: var(--space-8) var(--space-5) var(--space-6);
  text-align: center;
}

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

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 0.25rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

header h1 {
  font-size: clamp(1.3rem, 4vw, 1.875rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.9375rem;
  opacity: 0.88;
  margin-top: 0.5rem;
}

/* ============ Container ============ */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4);
}

/* ============ Card ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  transition: box-shadow var(--transition), transform var(--transition);
}

/* ============ Privacy Note ============ */
.privacy-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: #92400e;
  margin-bottom: var(--space-4);
}

/* ============ Ad Units ============ */
.ad-unit {
  min-height: 90px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  margin: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-light);
  font-size: 0.75rem;
}

/* ============ Section Title ============ */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* ============ Form ============ */
.tool-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-panel {
  /* uses .card */
}

.form-group-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.375rem;
  margin-bottom: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

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

.label-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.125rem;
}

.parttime-note {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

.input-suffix-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

.input-suffix-wrap input {
  flex: 1;
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

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

input[type="number"],
select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

input[type="number"]::-webkit-inner-spin-button {
  opacity: 1;
}

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

/* ============ Results Panel ============ */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Main result card */
.result-main-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

.result-main-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
}

.result-main-block {
  text-align: center;
}

.result-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.result-unit {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

.result-divider {
  width: 1px;
  height: 60px;
  background: #fde68a;
}

/* Filing badge */
.badge-wrap {
  display: flex;
  justify-content: center;
}

.filing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 700;
  min-height: 44px;
  transition: all var(--transition);
}

.filing-badge.badge-ok {
  background: #f0fdf4;
  border: 2px solid #86efac;
  color: #15803d;
}

.filing-badge.badge-required {
  background: #fff1f2;
  border: 2px solid #fda4af;
  color: #be123c;
}

.filing-badge.badge-recommended {
  background: #fffbeb;
  border: 2px solid #fcd34d;
  color: #b45309;
}

/* Comparison table */
.comparison-card {
  /* uses .card */
}

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

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

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

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

.comparison-table th,
.comparison-table td {
  padding: 0.625rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

.comparison-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.comparison-table .highlight-row td {
  background: var(--primary-light);
  font-weight: 700;
  color: var(--primary);
}

.comparison-table .diff-row td {
  text-align: center;
  font-weight: 700;
  color: #4b5563;
  background: #f8fafc;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.comparison-table .net-income-row td {
  text-align: center;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  font-size: 0.9rem;
  border-bottom: none;
}

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

.chart-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  height: 280px;
}

/* ============ Howto Section ============ */
.howto-section {
  margin-top: var(--space-4);
}

.howto-steps {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-10);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: var(--space-5);
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.7;
}

.howto-steps li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.howto-steps li:last-child {
  margin-bottom: 0;
}

/* ============ Accordion ============ */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.accordion-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: var(--space-4) var(--space-5);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  min-height: 52px;
  transition: background var(--transition);
}

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

.accordion-summary:hover {
  background: #fafaf9;
}

.accordion-summary > i:first-child {
  color: var(--primary);
  flex-shrink: 0;
}

.accordion-icon {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.accordion-body p {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.75;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-list dt {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.faq-list dd {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.7;
  margin-left: 0;
}

/* Ref list */
.ref-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--space-4);
}

.ref-list a {
  color: var(--primary);
  text-decoration: underline;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.ref-list a:hover {
  color: var(--primary-hover);
}

/* Disclaimer */
.disclaimer-note {
  background: #fafaf9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.65;
}

.disclaimer-note strong {
  color: var(--text);
}

/* ============ Footer ============ */
footer {
  margin-top: var(--space-12);
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

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

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--muted-light);
}

/* ============ Responsive ============ */
@media (min-width: 640px) {
  .container {
    padding: var(--space-6) var(--space-6);
  }

  .card {
    padding: var(--space-6) var(--space-8);
  }

  .result-value {
    font-size: 2.75rem;
  }

  .chart-container {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .result-main-inner {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .result-divider {
    width: 60px;
    height: 1px;
    margin: 0 auto;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
  }
}
