/* =============================================
   妊娠週数・出産予定日計算ツール
   Design System: Pink (#db2777)
   ============================================= */

:root {
  --primary: #db2777;
  --primary-hover: #be185d;
  --primary-rgb: 219, 39, 119;
  --primary-light: #fce7f3;
  --primary-border: #fbcfe8;
  --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 {
  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: var(--primary);
  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.92;
}

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

.subtitle {
  font-size: 0.875rem;
  opacity: 0.88;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* =============================================
   Main Layout
   ============================================= */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* =============================================
   Privacy Notice
   ============================================= */
.privacy-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.privacy-notice i {
  color: var(--primary);
  flex-shrink: 0;
  font-size: 1rem;
}

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

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

/* =============================================
   Tool Section
   ============================================= */
.tool-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}

/* =============================================
   Form
   ============================================= */
.form-grid {
  display: grid;
  gap: 1rem;
}

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

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.required {
  font-size: 0.75rem;
  background: #fee2e2;
  color: #dc2626;
  padding: 1px 6px;
  border-radius: 100px;
  font-weight: 600;
}

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

input[type="date"],
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);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

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

/* =============================================
   Buttons
   ============================================= */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform 0.12s ease, box-shadow var(--transition), color var(--transition);
  min-height: 44px;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.30);
}

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

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(var(--primary-rgb), 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* =============================================
   Error Message
   ============================================= */
.error-msg {
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #dc2626;
  font-size: 0.875rem;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* =============================================
   Result Area
   ============================================= */
.result-area {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.result-area[hidden] {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.result-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.result-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.result-card--primary {
  background: linear-gradient(135deg, var(--primary-light), #fdf2f8);
  border: 1px solid var(--primary-border);
}

.result-card__icon {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 0.375rem;
}

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

.result-card__value {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  font-family: 'Outfit', sans-serif;
}

.result-card__sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =============================================
   Pregnancy Calendar / Milestones
   ============================================= */
.calendar-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

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

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

.calendar-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.milestone-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background var(--transition);
  position: relative;
}

.milestone-item--past {
  opacity: 0.55;
}

.milestone-item--current {
  background: var(--primary-light);
  border-color: var(--primary);
  border-left-width: 4px;
}

.milestone-item--future {
  background: var(--surface);
}

.milestone-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.milestone-item--current .milestone-icon {
  color: var(--primary);
}

.milestone-item--past .milestone-icon {
  color: var(--text-weak);
}

.milestone-body {
  flex: 1;
  min-width: 0;
}

.milestone-week {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.milestone-item--current .milestone-week {
  color: var(--primary);
}

.milestone-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 1px 0;
}

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

.milestone-badge {
  font-size: 0.7rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  flex-shrink: 0;
  align-self: center;
}

/* =============================================
   Result Notice
   ============================================= */
.result-notice {
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
}

.result-notice i {
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

/* =============================================
   Ad Units
   ============================================= */
.ad-unit {
  min-height: 0;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* =============================================
   Howto Section
   ============================================= */
.howto-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}

details > summary {
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  user-select: none;
}

details > summary::before {
  content: '\25B6';
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] > summary::before {
  transform: rotate(90deg);
}

details > summary::-webkit-details-marker {
  display: none;
}

.howto-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-top: 0.75rem;
}

.howto-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

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

.howto-steps li div {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.howto-steps li div strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

/* =============================================
   Info Cards
   ============================================= */
.info-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}

.info-cards {
  display: grid;
  gap: 0.875rem;
}

.info-card {
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.info-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.info-card h3 i {
  color: var(--primary);
}

.info-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* =============================================
   FAQ Section
   ============================================= */
.faq-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.875rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  user-select: none;
}

.faq-item > summary::before {
  content: '\25B6';
  font-size: 0.6rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] > summary::before {
  transform: rotate(90deg);
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding: 0 0 0.875rem 1.25rem;
}

/* =============================================
   Disclaimer Section
   ============================================= */
.disclaimer-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}

.disclaimer-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border);
}

.disclaimer-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.mt-8 {
  margin-top: 0.75rem;
}

.ref-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.ref-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.ref-links a:hover {
  text-decoration: underline;
}

/* =============================================
   Footer
   ============================================= */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
}

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

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

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

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

.footer-links span {
  color: var(--border);
}

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

/* =============================================
   Responsive — Tablet (640px+)
   ============================================= */
@media (min-width: 640px) {
  main {
    padding: 1.5rem 2rem;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn-group {
    flex-direction: row;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;
  }

  .result-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-cards {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Responsive — Desktop (900px+)
   ============================================= */
@media (min-width: 900px) {
  .info-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
