/* =================================================================
   SURVEY PAGE — Premium Glassmorphism Wizard UI (Global)
   ================================================================= */

/* Wrapper */
.survey-page-wrapper {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  animation: surveyFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

/* =================================================================
   SAVE TOAST NOTIFICATION
   ================================================================= */
.save-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.save-toast-show {
  transform: translateX(0);
  opacity: 1;
}

/* =================================================================
   STATE CARDS (Error / Success)
   ================================================================= */
.survey-state-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.state-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.8rem;
}
.state-icon-error {
  background: #fef2f2;
  color: #ef4444;
  box-shadow: 0 0 0 8px #fff5f5, inset 0 2px 4px rgba(239, 68, 68, 0.1);
}
.state-icon-success {
  background: #ecfdf5;
  color: #10b981;
  box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.06), inset 0 2px 4px rgba(16, 185, 129, 0.1);
}

.state-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.state-desc {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 0;
  line-height: 1.5;
}

/* Error Help Box */
.state-help-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  max-width: 420px;
  margin: 2rem auto 0;
  text-align: left;
  font-size: 0.85rem;
}
.state-help-box > i {
  color: #6366f1;
  font-size: 1.25rem;
  margin-top: 2px;
}
.state-help-box strong {
  display: block;
  color: #334155;
  margin-bottom: 0.25rem;
}
.state-help-box p {
  color: #64748b;
  margin: 0;
}

/* Success Card */
.survey-success-card { border-color: rgba(16, 185, 129, 0.15); }
.success-bar {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Submission Summary */
.submission-summary {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 480px;
  margin: 2rem auto 0;
  text-align: left;
}
.summary-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.summary-heading i { color: #10b981; font-size: 1rem; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.summary-row strong { color: #475569; font-weight: 600; }
.summary-row span { color: #0f172a; font-weight: 500; }
.summary-row-last { border-bottom: none; }
.summary-value-highlight {
  background: white;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  font-weight: 600 !important;
}

/* =================================================================
   WIZARD CARD
   ================================================================= */
.survey-wizard {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Wizard Header */
.wizard-header {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.5), rgba(248, 250, 252, 0.8));
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.75rem 2rem 1.5rem;
}
.wizard-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.wizard-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.wizard-title-icon {
  width: 38px; height: 38px;
  background: #eef2ff;
  color: #6366f1;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: inset 0 2px 4px rgba(99, 102, 241, 0.1);
}
.wizard-po-badge {
  background: white;
  color: #6366f1;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #e0e7ff;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.wizard-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}
.wizard-subtitle strong { color: #334155; }

/* Review Alert */
.wizard-alert {
  margin: 1.25rem 2rem 0;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.85rem;
}
.wizard-alert > i { color: #f59e0b; font-size: 1.1rem; margin-top: 2px; }
.wizard-alert strong { display: block; color: #92400e; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.wizard-alert p { color: #a16207; margin: 0; }

/* =================================================================
   STEPPER (Clickable)
   ================================================================= */
.stepper-container {
  padding: 1.75rem 2rem 2.25rem;
  position: relative;
}
.stepper-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.stepper-track {
  position: absolute;
  top: calc(1.75rem + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 10rem);
  max-width: 320px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 999px;
  z-index: 1;
  overflow: hidden;
}
.stepper-progress {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.stepper-step:hover {
  opacity: 0.8;
}
.step-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: white;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.stepper-step-active .step-circle {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transform: scale(1.08);
}
.stepper-step-done .step-circle {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  border-color: transparent;
}
.step-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  transition: color 0.3s;
  white-space: nowrap;
}
.stepper-step-active .step-label { color: #6366f1; }

/* =================================================================
   WIZARD BODY
   ================================================================= */
.wizard-body {
  flex: 1;
  padding: 0 2rem 1.5rem;
  min-height: 380px;
}
.step-content {
  animation: stepFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Section Title */
.section-title {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title i { color: #6366f1; font-size: 1rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}
.section-header .section-title { margin: 0; padding: 0; border: none; }

.section-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.section-desc strong { color: #334155; }

.unit-badge {
  background: #eef2ff;
  color: #6366f1;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #e0e7ff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.unit-badge i { font-size: 0.65rem; }

/* =================================================================
   PO DETAILS GRID (Step 1)
   ================================================================= */
.po-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  background: rgba(248, 250, 252, 0.5);
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}
.po-detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem;
  background: white;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.po-detail-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.po-detail-value {
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 500;
}
.po-detail-value-bold { font-weight: 700; }
.quantity-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Checklist Box (Step 1) */
.checklist-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.checklist-title {
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.checklist-title i { color: #6366f1; }
.checklist-items { display: flex; flex-direction: column; gap: 0.75rem; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}
.checklist-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.checklist-icon-fiber { background: #fef3c7; color: #d97706; }
.checklist-icon-pkg { background: #dbeafe; color: #3b82f6; }
.checklist-item strong {
  display: block;
  font-size: 0.85rem;
  color: #1e293b;
  margin-bottom: 0.15rem;
}
.checklist-item p {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
}

/* Info Box */
.info-box {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: #1e40af;
}
.info-box-icon {
  width: 30px; height: 30px;
  background: #dbeafe;
  color: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.info-box strong { display: block; font-size: 0.88rem; margin-bottom: 0.3rem; color: #1e40af; }
.info-box p { margin: 0; color: #2563eb; line-height: 1.5; }

/* =================================================================
   FORM CATEGORIES (Grouped Fields)
   ================================================================= */
.form-category {
  background: #fafbfc;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef0f4;
}
.category-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.category-icon-cotton { background: #fef3c7; color: #d97706; }
.category-icon-synthetic { background: #e0e7ff; color: #6366f1; }
.category-icon-box { background: #fce7f3; color: #db2777; }
.category-icon-tag { background: #dbeafe; color: #3b82f6; }
.category-icon-hanger { background: #f3e8ff; color: #9333ea; }

.category-title {
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.category-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Eco Tags */
.eco-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  background: #eef2ff;
  color: #6366f1;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.03em;
}
.eco-tag-green {
  background: #ecfdf5;
  color: #10b981;
}

/* =================================================================
   FORM GRID
   ================================================================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem 0.85rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.form-field:focus-within label {
  color: #6366f1;
}
.input-wrapper {
  position: relative;
}
.input-wrapper input {
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.6rem 2rem 0.6rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  outline: none;
  font-family: inherit;
}
.input-wrapper input::placeholder {
  color: #cbd5e1;
  font-weight: 400;
}
.input-wrapper input:focus {
  background: white;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 1px 2px rgba(0,0,0,0.02);
}
.input-suffix {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  pointer-events: none;
}

/* Total Summary Bar */
.total-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #e0e7ff;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
}
.total-summary-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}
.total-summary-left i { color: #6366f1; font-size: 1rem; }
.total-summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: "Outfit", sans-serif;
  color: #94a3b8;
  transition: all 0.3s;
}
.total-has-value {
  color: #4f46e5;
}

/* =================================================================
   WIZARD FOOTER (with Progress Bar)
   ================================================================= */
.wizard-footer {
  background: rgba(248, 250, 252, 0.85);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding: 0;
}
.wizard-footer-progress {
  padding: 0.85rem 2rem 0;
}
.footer-progress-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.footer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.footer-progress-text {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.wizard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem 1.25rem;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.wizard-footer-left,
.wizard-footer-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Wizard Buttons */
.wizard-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
}
.wizard-btn-secondary {
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.wizard-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.wizard-btn-primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.wizard-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.wizard-btn-submit {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  padding: 0.65rem 1.5rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.wizard-btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}
.wizard-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =================================================================
   ANIMATIONS
   ================================================================= */
@keyframes surveyFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
  .survey-page-wrapper { max-width: 100%; }
  .wizard-header { padding: 1.25rem 1.25rem 1rem; }
  .wizard-body { padding: 0 1.25rem 1.25rem; }
  .wizard-footer-progress { padding: 0.75rem 1.25rem 0; }
  .wizard-footer-actions { padding: 0.75rem 1.25rem 1rem; }
  .stepper-container { padding: 1.25rem 1.25rem 1.75rem; }
  .form-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem 0.7rem; }
  .po-details-grid { grid-template-columns: 1fr; }
  .wizard-title { font-size: 1.2rem; }
  .state-title { font-size: 1.35rem; }
  .survey-state-card { padding: 2.5rem 1.5rem; }
  .wizard-alert { margin: 1rem 1.25rem 0; }
  .form-category { padding: 1rem; }
  .wizard-po-badge { display: none; }
  .save-toast { right: 16px; top: 70px; }
}

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .wizard-footer-left,
  .wizard-footer-right {
    width: 100%;
  }
  .wizard-btn { width: 100%; justify-content: center; }
  .category-header { gap: 0.5rem; }
  .checklist-item { flex-direction: column; text-align: center; align-items: center; }
}
