/* ==========================================================================
   RAHAF FITNESS - LIGHT & COLORFUL INTERACTIVE COMPONENTS & WIZARD STYLING
   ========================================================================== */

/* --- 5-STEP "BUILD YOUR PROGRAM" CONSULTATION WIZARD CONTAINER --- */
.consultation-wizard-section {
  background: var(--bg-pastel-peach);
  border-top: 1px solid var(--bg-pastel-peach-border);
  border-bottom: 1px solid var(--bg-pastel-peach-border);
  position: relative;
}

.wizard-white-card {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-medium);
  overflow: hidden;
  position: relative;
}

/* Wizard Header & Progress Track */
.wizard-header-strip {
  padding: 36px 40px 24px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
  .wizard-header-strip {
    padding: 24px 20px 18px;
  }
}

.wizard-progress-bar-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.wizard-progress-bar-fill {
  height: 100%;
  width: 20%; /* Step 1 of 5 initially */
  background: linear-gradient(90deg, var(--accent-coral) 0%, #FFA07A 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--accent-coral-glow);
}

/* 5 Steps Nav Nodes */
.wizard-steps-pill-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
}

.wizard-step-node-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.wizard-step-node-btn .step-digit {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E2E8F0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.wizard-step-node-btn.active {
  color: var(--accent-coral);
}

.wizard-step-node-btn.active .step-digit {
  background: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: 0 4px 10px var(--accent-coral-glow);
}

.wizard-step-node-btn.completed {
  color: var(--accent-mint);
}

.wizard-step-node-btn.completed .step-digit {
  background: var(--bg-pastel-mint);
  color: var(--accent-mint);
}

/* Mobile Step Meta Pill */
.wizard-step-mobile-meta {
  display: none;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-coral);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .wizard-steps-pill-nav {
    display: none;
  }
  .wizard-step-mobile-meta {
    display: flex;
  }
}

/* Wizard Form Body */
.wizard-form-container {
  padding: 40px;
  min-height: 480px;
}

@media (max-width: 768px) {
  .wizard-form-container {
    padding: 24px 18px;
  }
}

.step-panel {
  display: none;
  animation: fadeInStep 0.4s ease forwards;
}

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

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

.step-panel-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-panel-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Step 01: 2-Column Grid */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 640px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Step 02: Goals Selectable Cards */
.goal-cards-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.goal-card-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.goal-card-btn:hover {
  background: #FFFFFF;
  border-color: var(--accent-coral);
}

.goal-card-btn input[type="checkbox"] {
  display: none;
}

.goal-check-square {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  color: transparent;
  font-weight: 800;
  font-size: 0.85rem;
}

.goal-card-btn.selected {
  background: var(--accent-coral-light);
  border-color: var(--accent-coral);
  box-shadow: 0 4px 14px var(--accent-coral-glow);
}

.goal-card-btn.selected .goal-check-square {
  background: var(--accent-coral);
  border-color: var(--accent-coral);
  color: #FFFFFF;
}

.goal-card-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Step 03: Training Experience & Environment Cards */
.options-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.option-radio-card {
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.option-radio-card:hover {
  background: #FFFFFF;
  border-color: var(--accent-coral);
}

.option-radio-card.selected {
  background: var(--accent-coral-light);
  border-color: var(--accent-coral);
  box-shadow: 0 4px 16px var(--accent-coral-glow);
}

.option-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.option-card-icon {
  font-size: 1.35rem;
}

.custom-radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.option-radio-card.selected .custom-radio-circle {
  border-color: var(--accent-coral);
}

.option-radio-card.selected .custom-radio-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-coral);
  border-radius: 50%;
}

.option-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.option-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Slider Controls */
.slider-control-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.slider-counter-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.big-number-accent {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent-coral);
  line-height: 1;
}

.slider-track-input {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: #E2E8F0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-track-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-coral);
  cursor: pointer;
  box-shadow: 0 4px 10px var(--accent-coral-glow);
  transition: transform var(--transition-fast);
}

.slider-track-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Step 04: Health & Physical Considerations */
.health-toggle-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.health-toggle-pill {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-medium);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.health-toggle-pill:hover {
  border-color: var(--text-primary);
}

.health-toggle-pill.selected {
  background: var(--accent-mint-light);
  border-color: var(--accent-mint);
  color: var(--accent-mint);
  box-shadow: var(--shadow-mint);
}

.health-toggle-pill.selected.coral-alert {
  background: var(--accent-coral-light);
  border-color: var(--accent-coral);
  color: var(--accent-coral);
  box-shadow: var(--shadow-coral);
}

.health-conditional-container {
  display: none;
  background: #FFF8F5;
  border: 1px solid var(--bg-pastel-peach-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  animation: fadeInStep 0.3s ease;
}

.health-conditional-container.visible {
  display: block;
}

.health-safety-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #EFF6FF;
  border-left: 4px solid var(--accent-blue);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 24px;
}

.health-safety-notice-box svg {
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

.health-safety-notice-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Step 05: Live Consultation Summary Card */
.consultation-summary-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 24px;
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-medium);
}

.summary-card-header strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-coral);
}

.summary-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .summary-items-grid {
    grid-template-columns: 1fr;
  }
}

.summary-item-cell label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.summary-item-cell span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
}

.consultation-submit-note {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft-mint);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consultation-submit-note strong {
  color: var(--text-primary);
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.88;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Wizard Navigation Footer */
.wizard-footer-bar {
  padding: 24px 40px;
  background: #FAFAFA;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wizard-footer-left {
  display: flex;
  align-items: center;
}

.wizard-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-template-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #FFFFFF;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-medium);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 14px 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  user-select: none;
  text-decoration: none;
}

.btn-template-preview svg {
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.btn-template-preview:hover {
  background: #F8FAFC;
  color: var(--accent-coral);
  border-color: rgba(255, 110, 74, 0.45);
  box-shadow: 0 6px 18px rgba(255, 110, 74, 0.12);
  transform: translateY(-2px);
}

.btn-template-preview:hover svg {
  color: var(--accent-coral);
  transform: scale(1.08);
}

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

@media (max-width: 768px) {
  .wizard-footer-bar {
    padding: 20px 18px;
  }
}

@media (max-width: 580px) {
  .wizard-header-strip {
    padding: 20px 16px 14px;
  }
  .wizard-form-container {
    padding: 22px 16px;
    min-height: auto;
  }
  .step-panel-title {
    font-size: 1.4rem;
  }
  .step-panel-desc {
    font-size: 0.92rem;
    margin-bottom: 20px;
  }
  .goal-cards-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .goal-card-btn {
    min-height: 48px;
    padding: 14px 16px;
  }
  .options-radio-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .option-radio-card {
    padding: 16px 14px;
  }
  .slider-control-box {
    padding: 18px 14px;
  }
  .slider-track-input::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  .health-toggle-pill {
    min-height: 48px;
    padding: 14px 12px;
  }
  .wizard-footer-bar {
    flex-direction: column-reverse;
    gap: 10px;
    padding: 16px;
  }
  .wizard-footer-left,
  .wizard-footer-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .wizard-footer-bar .btn,
  .wizard-footer-bar button,
  .btn-template-preview {
    width: 100% !important;
    justify-content: center;
    text-align: center;
    min-height: 48px;
  }
  .wizard-footer-bar .btn-ghost {
    border: 1px solid var(--border-medium);
  }
}

/* Confirmation Success State */
.wizard-confirmation-view {
  display: none;
  padding: 60px 40px;
  text-align: center;
}

.wizard-confirmation-view.active {
  display: block;
  animation: fadeInStep 0.5s ease;
}

.confirmation-check-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-soft-mint, #F0FDF4);
  border: 2px solid var(--accent-mint, #10B981);
  color: var(--accent-mint, #10B981);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.confirmation-check-badge svg {
  display: block;
}

.confirmation-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.confirmation-lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.confirmation-roadmap-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 660px;
  margin: 0 auto 36px;
  text-align: left;
}

.confirmation-roadmap-box h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-coral);
  margin-bottom: 18px;
}

.roadmap-step-line {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.roadmap-step-line:last-child {
  margin-bottom: 0;
}

.roadmap-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-coral, #FF6E4A);
  color: #FFFFFF;
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 2px;
  box-shadow: 0 4px 10px rgba(255, 110, 74, 0.25);
}

.roadmap-text {
  flex: 1;
}

.roadmap-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.roadmap-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.confirmation-buttons-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 580px) {
  .wizard-confirmation-view {
    padding: 36px 16px;
  }
  .confirmation-check-badge {
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
  }
  .confirmation-roadmap-box {
    padding: 20px 16px;
  }
  .confirmation-buttons-group {
    flex-direction: column;
    width: 100%;
  }
  .confirmation-buttons-group .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content-box {
  position: relative;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.lightbox-img-wrapper {
  flex: 1;
  max-height: 70vh;
  overflow: hidden;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-footer {
  padding: 20px 28px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
}

.lightbox-caption-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.lightbox-caption-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-coral);
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: var(--accent-coral);
  color: #FFFFFF;
  border-color: var(--accent-coral);
}

/* Certificate Preview Modal */
.cert-modal-box {
  max-width: 560px;
  padding: 38px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-medium);
}

.cert-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.cert-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-pastel-mint);
  color: var(--accent-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: #FFFFFF;
  border: 1.5px solid var(--accent-coral);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInToast 0.3s ease;
  min-width: 280px;
}

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

/* ==========================================================================
   Workout Program Template Preview Modal
   ========================================================================== */
.template-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-modal-card {
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  max-height: 880px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
  flex-shrink: 0;
}

.template-modal-header-text {
  flex: 1;
}

.template-modal-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-coral);
  margin-bottom: 4px;
}

.template-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 6px 0;
}

.template-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 740px;
}

.btn-close-template-modal {
  background: var(--bg-surface-alt);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-close-template-modal:hover {
  background: var(--border-medium);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.btn-close-template-modal svg {
  width: 20px;
  height: 20px;
}

.template-modal-body {
  flex: 1;
  min-height: 0;
  background: #F1F5F9;
  position: relative;
  overflow: hidden;
}

.template-pdf-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
}

.template-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.template-modal-footer {
  padding: 16px 28px;
  background: #FAFAFA;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.btn-template-action {
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .template-modal-backdrop {
    padding: 12px;
  }
  .template-modal-card {
    height: 94vh;
    max-height: none;
    border-radius: var(--radius-lg);
  }
  .template-modal-header {
    padding: 18px 16px 14px;
  }
  .template-modal-title {
    font-size: 1.22rem;
  }
  .template-modal-desc {
    font-size: 0.82rem;
  }
  .template-modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .template-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}
