/* ======================================================
   免許診断フローチャート モーダル
   ====================================================== */

/* --- Overlay --- */
.lfc-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 20px;
}

.lfc-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* --- Modal --- */
.lfc-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lfc-overlay.is-active .lfc-modal {
  transform: translateY(0) scale(1);
}

/* --- Close --- */
.lfc-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lfc-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.lfc-close::before,
.lfc-close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: #666;
  border-radius: 1px;
}

.lfc-close::before {
  transform: rotate(45deg);
}

.lfc-close::after {
  transform: rotate(-45deg);
}

/* --- Header --- */
.lfc-header {
  padding: 28px 28px 0;
  text-align: center;
  flex-shrink: 0;
}

.lfc-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 10px;
  background: linear-gradient(135deg, #fdf6f2 0%, #f8ece5 100%);
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lfc-header__kicker {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-color, #e8a48c);
  letter-spacing: 0.2em;
  margin: 0 0 6px;
  opacity: 0.7;
}

.lfc-header__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #333;
  margin: 0;
  letter-spacing: 0.06em;
  line-height: 1.4;
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}

.lfc-header__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--accent-color, #e8a48c);
  border-radius: 2px;
}

.lfc-header__accent {
  color: var(--accent-color, #e8a48c);
}

/* --- Progress --- */
.lfc-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 28px 0;
  flex-shrink: 0;
}

.lfc-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e8e3de;
  transition: background 0.3s ease, transform 0.3s ease;
}

.lfc-progress__dot.is-active {
  background: var(--accent-color, #e8a48c);
  transform: scale(1.2);
}

.lfc-progress__dot.is-done {
  background: var(--accent-color, #e8a48c);
  opacity: 0.5;
}

.lfc-progress__line {
  width: 24px;
  height: 2px;
  background: #e8e3de;
  border-radius: 1px;
  transition: background 0.3s ease;
}

.lfc-progress__line.is-done {
  background: var(--accent-color, #e8a48c);
  opacity: 0.5;
}

/* --- Body --- */
.lfc-body {
  padding: 24px 28px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* --- Step (Question) --- */
.lfc-step {
  animation: lfc-fadeIn 0.35s ease;
}

@keyframes lfc-fadeIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lfc-step__question {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.6;
}

/* --- Options --- */
.lfc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lfc-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid #f0ebe4;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.lfc-option:hover {
  border-color: var(--accent-color, #e8a48c);
  background: #fdf6f2;
  transform: translateY(-1px);
}

.lfc-option:active {
  transform: scale(0.98);
}

.lfc-option__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #fdf6f2;
  border-radius: 10px;
}

.lfc-option:hover .lfc-option__icon {
  background: #f8ece5;
}

.lfc-option__body {
  flex: 1;
  min-width: 0;
}

.lfc-option__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.4;
}

.lfc-option__desc {
  font-size: 0.78rem;
  color: #888;
  margin: 3px 0 0;
  line-height: 1.5;
}

.lfc-option__arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  transition: color 0.2s ease, transform 0.2s ease;
}

.lfc-option:hover .lfc-option__arrow {
  color: var(--accent-color, #e8a48c);
  transform: translateX(2px);
}

/* --- Back --- */
.lfc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-top: 18px;
  border: none;
  background: none;
  color: #999;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lfc-back:hover {
  color: #555;
}

.lfc-back svg {
  width: 14px;
  height: 14px;
}

/* --- Result --- */
.lfc-result {
  text-align: center;
  animation: lfc-fadeIn 0.35s ease;
}

.lfc-result__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 14px;
  background: linear-gradient(135deg, #fdf6f2 0%, #f8ece5 100%);
  border-radius: 50%;
  margin-bottom: 16px;
}

.lfc-result__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #333;
  margin: 0 0 10px;
}

.lfc-result__desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.8;
  margin: 0 0 8px;
}

.lfc-result__conditions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 20px;
}

.lfc-result__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #fdf6f2;
  border-radius: 20px;
  font-size: 0.76rem;
  color: #666;
  font-weight: 500;
}

.lfc-result__tag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lfc-result__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lfc-result__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  padding: 14px 32px;
  background: var(--sub-accent-color, #e8a48c);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.lfc-result__cta:hover {
  background: var(--dark-sub-accent-color, #d1907a);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.lfc-result__cta-sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  padding: 11px 28px;
  background: #fff;
  color: #666 !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 50px;
  border: 1.5px solid #e0dbd5;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.lfc-result__cta-sub:hover {
  border-color: var(--accent-color, #e8a48c);
  color: var(--accent-color, #e8a48c) !important;
  transform: translateY(-1px);
}

.lfc-result__cta-sub svg {
  width: 14px;
  height: 14px;
}

.lfc-result__restart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-top: 16px;
  border: none;
  background: none;
  color: #999;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lfc-result__restart:hover {
  color: #555;
}

/* --- Note result (age not met etc.) --- */
.lfc-result__note {
  padding: 16px 20px;
  background: #fdf6f2;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #777;
  line-height: 1.8;
  margin: 16px 0 20px;
}

.lfc-result__note strong {
  color: #555;
}

.lfc-result__alt-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--accent-color, #e8a48c) !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 50px;
  border: 2px solid var(--accent-color, #e8a48c);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.lfc-result__alt-cta:hover {
  background: #fdf6f2;
  transform: translateY(-1px);
}

/* --- Floating trigger button --- */
.lfc-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent-color, #e8a48c);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease, background 0.2s ease;
}

.lfc-trigger.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lfc-trigger:hover {
  background: color-mix(in srgb, var(--accent-color, #e8a48c) 85%, #000);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
}

.lfc-trigger__icon {
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 18px;
}

/* --- Responsive --- */
@media (max-width: 1023px) {

  .menkyo-shindan {
    display: none;
  }

  .lfc-trigger {
    bottom: 58px;
    left: 0px;
    padding: 10px 16px;
    font-size: 0.8rem;
    border-radius: 0 10px 10px 0;
  }
}
@media (max-width: 560px) {
  .lfc-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .lfc-modal {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
  }

  .lfc-header {
    padding: 20px 20px 0;
    flex-shrink: 0;
  }

  .lfc-progress {
    padding: 14px 20px 0;
    flex-shrink: 0;
  }

  .lfc-body {
    padding: 16px 20px 24px;
  }

  .lfc-header__icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-bottom: 8px;
  }

  .lfc-header__title {
    font-size: 1.1rem;
    padding-bottom: 10px;
  }

  .lfc-header__kicker {
    font-size: 0.55rem;
    margin-bottom: 4px;
  }

  .lfc-step__question {
    font-size: 0.95rem;
  }

  .lfc-option {
    padding: 14px 14px;
    gap: 12px;
  }

  .lfc-option__icon {
    width: 38px;
    height: 38px;
    padding: 6px;
  }

  .lfc-option__label {
    font-size: 0.88rem;
  }

  .lfc-result__icon {
    width: 50px;
    height: 50px;
    padding: 10px;
    margin-bottom: 10px;
  }

  .lfc-result__title {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  .lfc-result__desc {
    font-size: 0.82rem;
    line-height: 1.7;
  }

  .lfc-result__conditions {
    margin: 10px 0 14px;
  }

  .lfc-result__cta {
    padding: 12px 26px;
    font-size: 0.88rem;
    max-width: 100%;
  }

  .lfc-result__cta-sub {
    padding: 10px 24px;
    font-size: 0.82rem;
    max-width: 100%;
  }

  .lfc-result__actions {
    gap: 8px;
  }

  .lfc-trigger__icon {
    width: 16px;
    height: 16px;
  }
}

/* ======================================================
   フローチャート図 ダイアグラムモーダル
   ====================================================== */

/* --- Overlay --- */
.lfcd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lfcd-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* --- Modal --- */
.lfcd-modal {
  position: relative;
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lfcd-overlay.is-active .lfcd-modal {
  transform: scale(1);
}

/* --- Close --- */
.lfcd-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lfcd-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.lfcd-close::before,
.lfcd-close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: #666;
  border-radius: 1px;
}

.lfcd-close::before { transform: rotate(45deg); }
.lfcd-close::after  { transform: rotate(-45deg); }

/* --- Controls --- */
.lfcd-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lfcd-ctrl {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lfcd-ctrl:hover {
  background: rgba(0, 0, 0, 0.06);
}

.lfcd-ctrl--text {
  width: auto;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Viewport --- */
.lfcd-viewport {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lfcd-svg-wrap {
  width: 100%;
  height: 100%;
}

.lfcd-svg-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Link in result --- */
.lfc-result__diagram-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: #aaa;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lfc-result__diagram-link:hover {
  color: var(--accent-color, #e8a48c);
}

.lfc-result__diagram-link svg {
  width: 14px;
  height: 14px;
}

/* --- Responsive --- */
@media (max-width: 560px) {
  .lfcd-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .lfcd-controls {
    bottom: 12px;
    right: 12px;
  }
}
