/* ═══════════════════════════════════════════════════════════════
   CANVA BOOST — Autofacturación Design System
   Matching the Dashboard's Unbounded + Figtree typography
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Core Palette (from Dashboard) */
  --bg-dark: #0F0021;
  --bg-darker: #0A0016;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-glass: rgba(255, 255, 255, 0.08);

  /* Accents */
  --pink: #FF2B88;
  --purple: #834DFF;
  --neon-green: #00FFA3;
  --gold: #FDC800;
  --cyan: #00D4FF;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #FF2B88 0%, #834DFF 100%);
  --gradient-green: linear-gradient(135deg, #00FFA3 0%, #00D4FF 100%);
  --gradient-gold: linear-gradient(135deg, #FDC800 0%, #FF8C00 100%);
  --gradient-purple: linear-gradient(135deg, #834DFF 0%, #4A1D96 100%);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* Typography */
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Figtree', sans-serif;

  /* Spacing */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;

  /* Glows */
  --glow-pink: 0 0 40px rgba(255, 43, 136, 0.15);
  --glow-green: 0 0 40px rgba(0, 255, 163, 0.15);
  --glow-purple: 0 0 40px rgba(131, 77, 255, 0.15);
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(131, 77, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(255, 43, 136, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 255, 163, 0.05) 0%, transparent 40%);
}

/* ─── Background Orbs ──────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--pink);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--purple);
  bottom: -50px;
  left: -50px;
  animation-delay: -7s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--neon-green);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.08;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ─── Header ───────────────────────────────────────────────── */
#page-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(15, 0, 33, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon-wrap {
  filter: drop-shadow(0 0 10px rgba(131, 77, 255, 0.5));
}

.logo-img {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.accent-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ─── Main Container ───────────────────────────────────────── */
.main-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  position: relative;
  z-index: 1;
}

/* ─── Stepper ──────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.35;
  transition: all 0.4s ease;
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 0.7;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  transition: all 0.4s ease;
  flex-shrink: 0;
}

.step.active .step-number {
  background: var(--gradient-primary);
  border-color: var(--pink);
  color: white;
  box-shadow: 0 0 20px rgba(255, 43, 136, 0.3);
}

.step.completed .step-number {
  background: var(--gradient-green);
  border-color: var(--neon-green);
  color: white;
}

.step-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.step-line {
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 12px;
  border-radius: 2px;
  transition: background 0.4s ease;
  flex-shrink: 0;
}

.step-line.completed {
  background: var(--gradient-green);
}

/* ─── Step Cards ───────────────────────────────────────────── */
.step-card {
  display: none;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.step-card.active {
  display: block;
  animation: cardSlideIn 0.5s ease;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.card-glow {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-glow-success {
  background: var(--gradient-green);
}

.card-inner {
  padding: 48px 40px;
}

/* ─── Step Header ──────────────────────────────────────────── */
.step-header {
  text-align: center;
  margin-bottom: 36px;
}

.step-icon {
  display: inline-block;
  margin-bottom: 16px;
}

.step-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Forms ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-wrapper.full-width {
  grid-column: 1 / -1;
}

.input-wrapper label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.input-wrapper input,
.input-wrapper select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--purple);
  background: rgba(131, 77, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(131, 77, 255, 0.12);
}

.input-wrapper select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.input-wrapper select option {
  background: #1a0a2e;
  color: var(--text-primary);
}

.input-icon {
  position: absolute;
  right: 16px;
  top: 38px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-wrapper input:focus ~ .input-icon {
  color: var(--purple);
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: white;
  background: var(--gradient-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
}

.btn-primary:hover::before {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 43, 136, 0.3);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
}

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

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 16px;
  animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-info {
  background: rgba(131, 77, 255, 0.12);
  border: 1px solid rgba(131, 77, 255, 0.3);
  color: #c4b5fd;
}

/* ─── Purchase Summary ─────────────────────────────────────── */
.purchase-summary {
  background: rgba(0, 255, 163, 0.04);
  border: 1px solid rgba(0, 255, 163, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
}

.summary-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neon-green);
  background: rgba(0, 255, 163, 0.1);
  border: 1px solid rgba(0, 255, 163, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.summary-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.summary-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Purchase Selector (multiple purchases) ───────────────── */
.purchase-selector {
  margin-bottom: 24px;
}

.selector-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.purchase-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.purchase-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.purchase-option:hover {
  background: rgba(131, 77, 255, 0.08);
  border-color: rgba(131, 77, 255, 0.25);
}

.purchase-option.selected {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.1);
}

.po-product {
  font-weight: 600;
  font-size: 14px;
}

.po-details {
  display: flex;
  gap: 16px;
  align-items: center;
}

.po-amount {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--neon-green);
}

.po-date {
  font-size: 12px;
  color: var(--text-muted);
}

.po-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.purchase-option.invoiced {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

.purchase-option.invoiced:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.po-badge-invoiced {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-green);
  letter-spacing: 0.5px;
}

/* ─── Success ──────────────────────────────────────────────── */
.success-content {
  text-align: center;
}

.success-icon {
  margin-bottom: 24px;
  display: inline-block;
}

.check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkDraw 0.8s ease 0.3s forwards;
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.success-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.success-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.success-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.success-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.success-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--neon-green);
  word-break: break-all;
}

/* ─── Footer ───────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border-glass);
  position: relative;
  z-index: 1;
}

.page-footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.page-footer a {
  color: var(--purple);
  text-decoration: none;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: var(--pink);
}

.footer-note {
  margin-top: 8px;
  font-size: 12px !important;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .card-inner {
    padding: 32px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .step-header h2 {
    font-size: 20px;
  }

  .stepper {
    flex-wrap: wrap;
    gap: 8px;
  }

  .step-label {
    display: none;
  }

  .step-line {
    width: 24px;
    margin: 0 4px;
  }

  .summary-details {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
  }

  .logo-title {
    font-size: 18px;
  }

  .main-container {
    padding: 24px 16px 48px;
  }

  #page-header {
    padding: 16px 20px;
  }
}
