/**
 * Vincenzo Falace - Showcase Website
 * File: assets/css/pages/audit.css
 * Description: Styles specific to the interactive Mini-Audit Wizard, lead form, loading state, and Results Dashboard.
 */

/* ==========================================
   1. WIZARD CONTAINER & PROGRESS BAR
   ========================================== */
.audit-wizard-card {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: var(--space-3xl);
  padding: 0 var(--space-md);
}

.progress-line-bg {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--border-light-hsl);
  transform: translateY(-50%);
  z-index: 1;
}

.progress-line-fill {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-mixed);
  transform: translateY(-50%);
  z-index: 2;
  transition: width var(--transition-normal);
}

.step-indicator {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-elevated);
  border: 2px solid var(--border-light-hsl);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--font-size-small);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.step-label {
  font-family: var(--font-heading);
  font-size: var(--font-size-tiny);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  transition: color var(--transition-normal);
}

/* Progress States */
.step-indicator.active .step-dot {
  border-color: var(--accent-tech);
  color: var(--accent-tech);
  box-shadow: var(--glow-tech);
  background-color: var(--bg-surface);
}

.step-indicator.active .step-label {
  color: var(--text-primary);
}

.step-indicator.completed .step-dot {
  border-color: var(--accent-sale);
  color: #ffffff;
  background: var(--gradient-sale);
}

.step-indicator.completed .step-label {
  color: var(--text-secondary);
}

/* ==========================================
   2. WIZARD STEPS & QUESTIONS
   ========================================== */
.wizard-step {
  display: none;
  animation: fadeIn var(--transition-normal);
}

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

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

.wizard-step-title {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  text-align: center;
}

.wizard-step-desc {
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
  text-align: center;
}

/* Choices styling */
.question-block {
  margin-bottom: var(--space-2xl);
}

.question-text {
  font-family: var(--font-heading);
  font-size: var(--font-size-lead);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Glass card choice option */
.choice-card {
  display: block;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  transition: all var(--transition-normal);
}

/* Hidden real radio/checkbox input */
.choice-card input[type="radio"],
.choice-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.choice-circle {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.choice-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--accent-tech);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.choice-text {
  color: var(--text-secondary);
  font-size: 0.98rem;
  transition: color var(--transition-fast);
}

/* Hover effect */
.choice-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border-highlight);
}

/* Checked Choice state using :has() selector */
.choice-card:has(input:checked) {
  border-color: var(--accent-tech);
  background: rgba(0, 235, 248, 0.03);
  box-shadow: var(--glow-tech);
}

.choice-card:has(input:checked) .choice-circle {
  border-color: var(--accent-tech);
}

.choice-card:has(input:checked) .choice-circle::after {
  transform: scale(1);
}

.choice-card:has(input:checked) .choice-text {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

/* Navigation button wrapper */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--glass-border);
  padding-top: var(--space-xl);
}

/* ==========================================
   3. LOADING AND CALCULATION OVERLAY
   ========================================== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: var(--space-3xl);
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 235, 248, 0.1);
  border-top-color: var(--accent-tech);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-xl);
}

.loading-message {
  font-family: var(--font-heading);
  font-size: var(--font-size-h4);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  text-align: center;
}

.loading-subtext {
  color: var(--text-muted);
  font-size: var(--font-size-small);
  text-align: center;
}

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

/* ==========================================
   4. RESULTS DASHBOARD
   ========================================== */
.results-dashboard {
  display: none;
  animation: fadeIn var(--transition-slow);
}

.results-dashboard.active {
  display: block;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

/* Score Gauge layout */
.score-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.gauge-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: var(--space-lg);
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke: url(#tech-gradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 439.8; /* 2 * PI * r (r=70) */
  stroke-dashoffset: 439.8;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-fill-sale {
  stroke: url(#sale-gradient);
}

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-percentage {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
  line-height: 1;
}

.gauge-label {
  font-size: var(--font-size-tiny);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-top: 4px;
}

/* Color-coded badges for status level */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xxs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--font-size-tiny);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-top: var(--space-sm);
}

.badge-status.basso {
  background: rgba(244, 63, 94, 0.1);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-status.medio {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-status.alto {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Assessment Feedback text */
.feedback-box {
  margin-top: var(--space-md);
  font-size: 0.95rem;
  line-height: var(--lh-body);
}

/* Detailed recommendations */
.rec-section {
  margin-bottom: var(--space-3xl);
}

.rec-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.rec-title svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.rec-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.rec-bullet-list {
  list-style: none;
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rec-bullet-item {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  font-size: 0.925rem;
}

.rec-bullet-icon {
  color: var(--accent-tech);
  margin-top: 3px;
  flex-shrink: 0;
}

/* Priority Action plan card */
.action-plan-card {
  background: linear-gradient(135deg, rgba(255, 10, 159, 0.03) 0%, rgba(130, 48, 248, 0.05) 50%, rgba(11, 15, 25, 0.8) 100%);
  border: 1px solid rgba(255, 10, 159, 0.15);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(255, 10, 159, 0.04);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
}

.action-plan-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.action-plan-title svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-sale);
}

.action-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.action-step-item {
  display: flex;
  gap: var(--space-md);
}

.action-step-number {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--gradient-sale);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--font-size-tiny);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-step-text strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.action-step-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Restart section button */
.dashboard-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-3xl);
}

/* ==========================================
   5. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */
@media (max-width: 768px) {
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .score-gauge-card {
    padding: var(--space-xl) var(--space-md);
  }

  .progress-container {
    margin-bottom: var(--space-2xl);
  }

  .step-label {
    display: none;
  }
}

/* Custom Checkbox Square styling for Multi-Select Wizard Option Card */
.choice-circle.checkbox-mode {
  border-radius: var(--radius-xs);
}
.choice-circle.checkbox-mode::after {
  border-radius: 2px;
}

