/* ==============================================================================
   QR Magia — Wizard Stylesheet
   Inherits design principles (Poppins font, colors, cards) from styles.css.
   ============================================================================== */

:root {
  --magia-purple: #7135c8;
  --magia-purple-dark: #54209f;
  --magia-pink: #d62991;
  --magia-blue: #168eb5;
  --magia-cream: #fffaf7;
  --magia-soft: #fdf1f4;
  --magia-text: #25232a;
  --magia-muted: #6e6970;
  --magia-border: #eadfe5;
  --magia-gradient: linear-gradient(100deg, #8b4aab 0%, #ad55c1 100%);
}

body {
  background-color: var(--magia-cream);
  color: var(--magia-text);
  font-family: "Poppins", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.text-purple {
  color: var(--magia-purple);
}

.max-w-500 {
  max-width: 500px;
}

.max-w-700 {
  max-width: 700px;
}

.btn-magia {
  border: 0;
  color: #fff !important;
  background: var(--magia-gradient);
  border-radius: 999px;
  padding: 0.75rem 1.8rem;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(112, 44, 194, 0.2);
  transition: all 0.2s ease-in-out;
}

.btn-magia:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(112, 44, 194, 0.3);
}

.btn-magia:disabled {
  background: #d8ced3;
  color: #8c8286 !important;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.btn-outline-magia {
  color: var(--magia-purple);
  border: 1px solid #bfa7d7;
  background: #fff;
  border-radius: 999px;
  padding: 0.75rem 1.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-magia:hover {
  background: #fbf4ff;
  border-color: var(--magia-purple);
}

.btn-back-home {
  color: var(--magia-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.btn-back-home:hover {
  color: var(--magia-purple);
}

/* Wizard Steps Indicator */
.wizard-steps-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.wizard-steps-container::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--magia-border);
  z-index: 1;
}

.wizard-step {
  position: relative;
  z-index: 2;
  text-align: center;
  background: var(--magia-cream);
  padding: 0 10px;
}

.step-num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--magia-border);
  color: var(--magia-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--magia-muted);
}

.wizard-step.active .step-num {
  background: var(--magia-purple);
  border-color: var(--magia-purple);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(113, 53, 200, 0.15);
}

.wizard-step.active .step-label {
  color: var(--magia-purple);
  font-weight: 700;
}

.wizard-step.completed .step-num {
  background: var(--magia-pink);
  border-color: var(--magia-pink);
  color: #ffffff;
}

/* Wizard Panes */
.wizard-container {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--magia-border);
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 15px 50px rgba(64, 31, 67, 0.04);
}

.wizard-pane {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

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

.pane-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--magia-text);
}

.pane-subtitle {
  color: var(--magia-muted);
  font-size: 0.95rem;
}

/* Dropzone Area (Step 1) */
.dropzone-area {
  border: 2px dashed #bfa7d7;
  background: #fffbfd;
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-area.dragover {
  background: #f6eeff;
  border-color: var(--magia-purple);
  transform: scale(1.01);
}

.preview-ring-simulation {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto;
  overflow: hidden;
  border: 6px solid #ffffff;
  box-shadow: 0 12px 30px rgba(64, 31, 67, 0.15);
  position: relative;
}

.preview-ring-simulation::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 15px rgba(100, 75, 70, 0.2);
  z-index: 2;
}

.preview-ring-simulation img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Audio Section (Step 2) */
.audio-option-card {
  border: 1px solid var(--magia-border);
  background: var(--magia-cream);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.audio-option-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--magia-text);
}

.recording-box {
  background: #ffffff;
  border: 1px solid var(--magia-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.recording-timer {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--magia-text);
  margin-bottom: 0.5rem;
}

.btn-record {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: var(--magia-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 15px rgba(112, 44, 194, 0.2);
  transition: all 0.2s;
}

.btn-record.recording {
  background: var(--magia-pink);
  animation: pulseRecording 1.2s infinite;
}

@keyframes pulseRecording {
  50% { box-shadow: 0 0 0 12px rgba(214, 41, 145, 0.2); }
}

.audio-file-box {
  padding: 2rem 1rem;
  background: #ffffff;
  border: 1px solid var(--magia-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
}

/* Wave animation during recording */
.visual-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  margin: 1rem 0;
}

.visual-wave i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(#d72891, #7440c9);
  animation: microWave 1s infinite alternate;
}

.visual-wave i:nth-child(2n) { animation-delay: 0.15s; }
.visual-wave i:nth-child(3n) { animation-delay: 0.3s; }
.visual-wave i:nth-child(4n) { animation-delay: 0.45s; }

@keyframes microWave {
  100% { height: 28px; }
}

.border-purple-soft {
  border: 1px solid #f2e7ef;
}

.bg-pink {
  background-color: var(--magia-pink);
}

.btn-play-pause {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--magia-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Keychain Layout Preview (Step 3) */
.preview-keychain-container {
  background: var(--magia-cream);
  border: 1px solid var(--magia-border);
  border-radius: 24px;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
}

.keychain-side-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--magia-purple);
  margin-bottom: 1.5rem;
}

.keychain-preview-ring-outer {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  margin: 0 auto;
  border: 8px solid #ffffff;
  box-shadow: 0 15px 35px rgba(64, 31, 67, 0.12);
  position: relative;
  background: #ffffff;
}

.keychain-preview-ring-outer::before {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border: 6px solid #d4a753; /* Brass ring simulation */
  border-radius: 50%;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.keychain-preview-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.keychain-preview-ring-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-preview-box {
  background: #fbfbf9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-preview-sim {
  width: 60%;
  height: 60%;
  border: 3px solid #25232a;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-preview-sim i {
  font-size: 3rem;
  line-height: 1;
  color: #25232a;
}

.qr-preview-sim span {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-top: 3px;
}

.bg-soft-pink {
  background-color: var(--magia-soft);
}

/* Summary Card (Step 4) */
.summary-card {
  border: 1px solid var(--magia-border);
  border-radius: 20px;
  padding: 1.5rem;
  background: #ffffff;
}

.summary-thumbnail {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.summary-audio-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--magia-soft);
  color: var(--magia-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Success Result Details (Paso final) */
.success-icon {
  font-size: 4rem;
  color: #198754;
  line-height: 1;
}

.qr-result-box {
  background: #ffffff;
  border: 1px solid var(--magia-border);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.qr-result-box img {
  max-width: 200px;
  margin: 0 auto;
}

.url-result-box {
  background: #ffffff;
  border: 1px solid var(--magia-border);
  border-radius: 24px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 26, 52, 0.85);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .wizard-container {
    padding: 1.5rem;
    border-radius: 24px;
  }
  .pane-title {
    font-size: 1.4rem;
  }
}
