/* cong-cu.css - Thiết kế hiện đại cho công cụ IVF */
.page-cong-cu {
  background-color: #f4f9f8;
  overflow-x: clip;
}

.tool-intro {
  text-align: center;
  padding: 2.25rem 0 1rem;
}

.tool-intro .container {
  max-width: 48rem;
}

.tool-intro h1 {
  max-width: 13ch;
  margin: 0 auto .75rem;
  font-size: clamp(2.15rem, 10vw, 4.5rem);
  line-height: 1.02;
  text-wrap: balance;
}

.tool-intro .lead-text {
  max-width: 38rem;
  margin: 0 auto 1rem;
  color: #52635f;
  font-size: 1rem;
  line-height: 1.65;
}

.tool-intro-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: .625rem;
  max-width: 32rem;
  margin: 0 auto;
}

.tool-intro-actions .button {
  min-height: 48px;
  padding: .75rem .875rem;
  font-size: .92rem;
}

.tool-share-button {
  border: 1px solid #b11f55;
  color: #9b1c4b;
  background: #fff;
}

.tool-intro-note {
  max-width: 38rem;
  margin: .875rem auto 0;
  color: #687873;
  font-size: .82rem;
  line-height: 1.5;
}

.tool-section {
  padding-top: .75rem;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .375rem;
  width: 100%;
  margin: 0 auto 1rem;
  scroll-margin-top: 5.5rem;
}

.tool-tab {
  background: white;
  border: 1px solid #dbe5e2;
  padding: .65rem .25rem;
  border-radius: 14px;
  font-family: 'Figtree', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.15;
  color: #3f514d;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(20, 63, 58, .05);
  display: flex;
  min-width: 0;
  min-height: 76px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: .3rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.tool-tab:hover {
  border-color: #78958e;
  box-shadow: 0 4px 12px rgba(20, 63, 58, .08);
}

.tool-tab.active {
  background: #143f3a;
  color: white;
  border-color: #143f3a;
  box-shadow: 0 6px 16px rgba(20, 63, 58, .18);
}

.tool-tab:focus-visible {
  outline: 3px solid #f0a9bf;
  outline-offset: 2px;
}

.tab-index {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: #edf4f2;
  color: #143f3a;
  font-size: .7rem;
  letter-spacing: .04em;
}

.tool-tab.active .tab-index {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.tab-label-long {
  display: none;
}

.tool-panel {
  animation: fadeIn 0.4s ease-out forwards;
}

.tool-panel.active {
  display: block;
}

.tool-content-area,
.tool-panel,
.tool-grid,
.glass-panel {
  min-width: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.glass-panel {
  background: #fff;
  border: 1px solid #e1ebe8;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 22px rgba(20, 63, 58, .06);
  overflow: hidden;
}

.tool-form-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #143f3a;
}

.tool-form-card p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: 3px solid rgba(214, 51, 108, .16);
  outline-offset: 1px;
  border-color: #143f3a;
}

.tool-form-card .button,
.tool-result-card .button {
  min-height: 48px;
  white-space: normal;
  text-align: center;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-wrap input {
  flex-grow: 1;
}

.range-val {
  font-weight: 700;
  color: #143f3a;
  background: #e6efed;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  min-width: 50px;
  text-align: center;
}

.w-100 {
  width: 100%;
}

/* Result Styles */
.result-highlight {
  background: #fdfaf6;
  border-left: 4px solid #d99a5b;
  padding: 1rem;
  border-radius: 0 10px 10px 0;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
}

.result-highlight span {
  font-weight: 600;
  color: #555;
}

.result-highlight strong {
  font-size: 1.25rem;
  color: #d99a5b;
}

/* Calendar Row */
.calendar-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}

.cal-day {
  background: #f5f5f5;
  border-radius: 12px;
  min-width: 0;
  min-height: 76px;
  padding: 0.65rem 0.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 2px solid transparent;
}

.cal-day .dow {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
}

.cal-day .date {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.cal-day .icon {
  font-size: 0.9rem;
  height: 16px;
}

.cal-day.golden {
  background: #fff4f4;
  border-color: #ffb3b3;
}

.cal-day.golden .date {
  color: #d6336c;
}

.cal-day.ovulation-day {
  background: #ffe3e3;
  border-color: #fa5252;
}

.cal-day.ovulation-day .date {
  color: #c92a2a;
}

/* Medical Tip */
.medical-tip {
  background: #e6efed;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #143f3a;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
}

.fertility-signal-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .75rem;
  align-items: flex-start;
  margin-top: .75rem;
}

.fertility-signal-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #cce5ff;
  border-radius: 10px;
}

.fertility-signal-row picture {
  display: block;
  width: 72px;
  height: 72px;
}

.fertility-signal-row p {
  min-width: 0;
}

.medical-tip.tip-info {
  background: #eef2fa;
  color: #2b4c8c;
}

/* IVF Progress Bars */
.charts-container {
  margin-bottom: 2rem;
  margin-top: 1.5rem;
}

.progress-item {
  margin-bottom: 1.25rem;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  gap: .75rem;
}

.progress-labels span {
  min-width: 0;
}

.progress-bar {
  height: 12px;
  background: #eaeaea;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.fill-1 { background: linear-gradient(90deg, #a8d5ba, #6eb78c); }
.fill-2 { background: linear-gradient(90deg, #6eb78c, #369562); }
.fill-3 { background: linear-gradient(90deg, #369562, #143f3a); }

.disclaimer-text {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: #888;
  font-size: 0.8rem;
}

/* Radio Pills cho form nhập liệu */
.radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.radio-pill {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
  margin-bottom: 0;
}
.radio-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}
.radio-pill span {
  display: flex;
  min-height: 46px;
  height: 100%;
  align-items: center;
  padding: 0.6rem .75rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.radio-pill input:checked + span {
  background: #143f3a;
  color: #fff;
  border-color: #143f3a;
  box-shadow: 0 4px 6px rgba(20, 63, 58, 0.2);
}
.radio-pill span:hover {
  border-color: #143f3a;
}

.radio-pill input:focus-visible + span {
  outline: 3px solid rgba(214, 51, 108, .28);
  outline-offset: 2px;
}

.lead-gen-box {
  padding: 1rem !important;
}

.advice-list {
  margin-left: .25rem !important;
  padding-left: 1rem !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* EDD Timeline Styles */
.timeline-container {
  position: relative;
  margin: 1.5rem 0;
  padding-left: 20px;
  border-left: 3px solid #d6336c;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 15px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27.5px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  border: 3px solid #d6336c;
}

.timeline-item.past::before {
  background: #d6336c;
}

.timeline-item.past .timeline-title {
  color: #777;
  text-decoration: line-through;
}

.timeline-title {
  font-weight: 700;
  color: #143f3a;
  margin-bottom: 0.25rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: #d6336c;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-content {
  font-size: 0.9rem;
  color: #555;
  background: #f8fcfb;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e1e8e7;
}

.timeline-content strong {
  color: #143f3a;
}

@media (min-width: 32rem) {
  .calendar-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 40rem) {
  .form-group-row {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .glass-panel {
    padding: 1.5rem;
  }
}

@media (min-width: 48rem) {
  .tool-intro {
    padding: 3.5rem 0 1.5rem;
  }

  .tool-tabs {
    gap: .75rem;
    max-width: 62rem;
    margin-bottom: 1.5rem;
  }

  .tool-tab {
    min-height: 68px;
    padding: .8rem 1rem;
    flex-direction: row;
    font-size: .96rem;
  }

  .tab-label-short {
    display: none;
  }

  .tab-label-long {
    display: inline;
  }
}

@media (min-width: 56rem) {
  .tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
  }

  .glass-panel {
    padding: 2rem;
    border-radius: 20px;
  }
}

@media (max-width: 39.99rem) {
  .form-group-row[style] {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .radio-group[style] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .radio-group.radio-col-3[style] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .radio-group.radio-col-3 .radio-pill span {
    padding-inline: .35rem;
    font-size: .82rem;
    text-align: center;
    justify-content: center;
  }

  #edd-dashboard .result-highlight {
    padding: 1.25rem .875rem !important;
  }

  #dashboard-ga {
    font-size: 1.65rem !important;
  }

  .result-highlight strong {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-panel,
  .tool-tab,
  .radio-pill span,
  .progress-fill {
    animation: none;
    transition: none;
  }
}

/* Hub Cards Grid */
.hub-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
  max-width: 62rem;
  margin: 0 auto;
}

.hub-tool-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: .45rem 1rem;
  text-align: left;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  background: #fff;
  border: 1px solid #e1ebe8;
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(20, 63, 58, .04);
}

.hub-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(20, 63, 58, .1);
  border-color: #a8d5ba;
}

.hub-tool-icon {
  grid-row: 1 / 4;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  color: #143f3a;
  background: #eaf4f1;
  border-radius: 14px;
}

.hub-tool-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.hub-tool-card h3 {
  font-size: 1.4rem;
  color: #143f3a;
  margin: 0;
  font-family: 'Figtree', sans-serif;
  font-weight: 700;
}

.hub-tool-card p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 .35rem;
}

.hub-tool-card .button {
  min-height: 44px;
  padding: .7rem 1rem;
}

@media (min-width: 48rem) {
  .hub-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .hub-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
  }

  .hub-tool-icon {
    margin-bottom: .5rem;
  }

  .hub-tool-card h3 {
    margin-bottom: .35rem;
  }

  .hub-tool-card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
  }
}
