* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.main-container {
  max-width: 1000px;
  min-width: 500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
  background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
  color: white;
  padding: 50px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 20px);
  animation: headerPattern 20s linear infinite;
}

@keyframes headerPattern {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(20px, 20px);
  }
}

.header h1 {
  font-size: 42px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  font-weight: 800;
  letter-spacing: -1px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.header p {
  opacity: 0.95;
  font-size: 18px;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.content {
  padding: 50px 40px;
}

.step {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.form-card {
  background: white;
  border: 2px solid #f1f5f9;
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(255, 107, 107, 0.05) 0%,
      rgba(78, 205, 196, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s;
}

.form-card:hover {
  border-color: #ff6b6b;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.25);
}

.form-card:hover::before {
  opacity: 1;
}

.form-card.selected {
  border-color: #ff6b6b;
  background: linear-gradient(135deg, #fff5f5 0%, #f0fdfa 100%);
  box-shadow: 0 8px 30px rgba(255, 107, 107, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-4px);
}

.form-card.selected::after {
  content: "✓";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  animation: checkmark 0.3s ease-out;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

@keyframes checkmark {
  0% {
    transform: scale(0) rotate(-180deg);
  }

  50% {
    transform: scale(1.2) rotate(0deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

.form-preview {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 2px solid #f1f5f9;
}

.form-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.form-card:hover .form-preview img {
  transform: scale(1.1);
}

.form-preview-placeholder {
  font-size: 80px;
  opacity: 0.2;
  filter: grayscale(100%);
}

.form-info {
  padding: 24px;
  position: relative;
  z-index: 1;
}

.form-name {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.form-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.upload-section {
  margin-bottom: 40px;
}

.upload-label {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1e293b;
  font-size: 16px;
}

.file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-display {
  display: flex;
  align-items: center;
  padding: 24px;
  background: #f8fafc;
  border: 3px dashed #cbd5e1;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.file-input-display:hover {
  border-color: #ff6b6b;
  background: #fff5f5;
}

.file-input-display.has-file {
  border-style: solid;
  border-color: #4ecdc4;
  background: #f0fdfa;
}

.file-icon {
  font-size: 32px;
  margin-right: 16px;
}

.file-text {
  flex: 1;
  color: #64748b;
  font-size: 15px;
}

.file-text.has-file {
  color: #1e293b;
  font-weight: 600;
}

.fill-btn,
.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.fill-btn-primary,
.btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #d946a8 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.fill-btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-group {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.alert {
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 30px;
  display: flex;
  align-items: start;
  gap: 16px;
  border: 2px solid;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fbbf24;
  color: #92400e;
}

.alert-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #60a5fa;
  color: #1e40af;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #4ade80;
  color: #166534;
}

.alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.mapping-container {
  background: #f8fafc;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 30px;
  max-height: 500px;
  overflow-y: auto;
  border: 2px solid #e2e8f0;
}

.mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 3px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 10;
}

.mapping-header-item {
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mapping-row {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid #f1f5f9;
  transition: all 0.3s;
}

.mapping-row:hover {
  border-color: #ff6b6b;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
}

.mapping-field {
  flex: 1;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
}

.field-label {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  font-size: 15px;
}

.field-name {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #94a3b8;
  word-break: break-all;
  line-height: 1.4;
}

.mapping-arrow {
  color: #ff6b6b;
  font-size: 24px;
  flex-shrink: 0;
  font-weight: bold;
}

.mapping-select {
  width: 100%;
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  font-weight: 600;
  color: #1e293b;
}

.mapping-select:focus {
  outline: none;
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.file-info {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 30px;
  border: 2px solid #e2e8f0;
}

.file-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.file-info-row:last-child {
  border-bottom: none;
}

.file-info-label {
  font-weight: 700;
  color: #475569;
  font-size: 15px;
}

.file-info-value {
  color: #1e293b;
  font-family: monospace;
  font-weight: 600;
  font-size: 14px;
}

.selected-form-badge,
.sample-excel-file-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 16px;
  margin-bottom: 30px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-container {
  display: flex;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

/* Spinner Overlay */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.spinner-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ff6b6b;
  border-right-color: #4ecdc4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.spinner-subtext {
  font-size: 14px;
  opacity: 0.8;
}

/* Form Preview Images */
.form-preview-img {
  background: white;
  padding: 10px;
}