/* ==========================================================================
   HOMME SURVEY SUITE — PORSLINE-GRADE CONVERSATIONAL UI
   Awwwards & Stripe-level luxury dark glassmorphism, fluid motion, and zero-flicker UX
   ========================================================================== */

/* Shoor Rounded Persian Font Definitions */
@font-face {
  font-family: 'ShoorRounded';
  src: url('../fonts/ShoorRounded-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ShoorRounded';
  src: url('../fonts/ShoorRounded-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ShoorRounded';
  src: url('../fonts/ShoorRounded-ExtraBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ShoorRounded';
  src: url('../fonts/ShoorRounded-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --survey-bg: #030712;
  --survey-card-bg: rgba(13, 20, 36, 0.82);
  --survey-border: rgba(255, 255, 255, 0.1);
  --survey-border-active: rgba(0, 229, 212, 0.6);
  --survey-primary: #00e5d4;
  --survey-primary-glow: rgba(0, 229, 212, 0.35);
  --survey-text: #f8fafc;
  --survey-text-muted: #94a3b8;
  --survey-danger: #f43f5e;
  --survey-font: 'ShoorRounded', 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  --survey-radius: 20px;
  --survey-pill: 9999px;
  --survey-transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --survey-bg: #f8fafc;
  --survey-card-bg: rgba(255, 255, 255, 0.95);
  --survey-border: rgba(15, 23, 42, 0.1);
  --survey-border-active: rgba(0, 180, 216, 0.7);
  --survey-primary: #0284c7;
  --survey-primary-glow: rgba(2, 132, 199, 0.25);
  --survey-text: #0f172a;
  --survey-text-muted: #64748b;
  --survey-danger: #e11d48;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--survey-font) !important;
}

body.survey-body {
  font-family: var(--survey-font) !important;
  background-color: var(--survey-bg);
  color: var(--survey-text);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient Background Mesh */
.survey-mesh-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(0, 229, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
}

/* Top Sticky Navigation Bar */
.survey-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--survey-border);
}

.survey-top-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.survey-top-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.survey-top-brand-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.survey-badge-research {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(0, 229, 212, 0.12);
  border: 1px solid rgba(0, 229, 212, 0.35);
  border-radius: var(--survey-pill);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--survey-primary);
  letter-spacing: -0.2px;
}

.survey-exit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--survey-border);
  border-radius: var(--survey-pill);
  color: var(--survey-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--survey-transition);
}

.survey-exit-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Fluid Liquid Progress Bar Track */
.survey-progress-track {
  position: fixed;
  top: 64px;
  right: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 99;
}

.survey-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00e5d4 0%, #38bdf8 100%);
  box-shadow: 0 0 12px rgba(0, 229, 212, 0.6);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Main Viewport Container */
.survey-viewport {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 95px 20px 80px 20px;
  min-height: 100vh;
}

.survey-content-stage {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

/* Base Card Style with Clean Slide Transitions */
.survey-stage-card {
  background: var(--survey-card-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--survey-border);
  border-radius: var(--survey-radius);
  padding: 42px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}

/* Slide in from bottom */
.survey-stage-card.slide-in-up {
  animation: cardSlideInUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide out towards top */
.survey-stage-card.slide-out-up {
  animation: cardSlideOutUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide in from top (when going back) */
.survey-stage-card.slide-in-down {
  animation: cardSlideInDown 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide out towards bottom */
.survey-stage-card.slide-out-down {
  animation: cardSlideOutDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

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

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

.survey-stage-card.shake-error {
  animation: shakeAnim 0.45s ease-in-out;
  border-color: var(--survey-danger);
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.3);
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* WELCOME SCREEN */
.welcome-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 229, 212, 0.1);
  border: 1px solid rgba(0, 229, 212, 0.3);
  border-radius: var(--survey-pill);
  color: var(--survey-primary);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--survey-text);
}

.welcome-desc {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--survey-text-muted);
  margin-bottom: 28px;
}

.welcome-meta-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--survey-border);
  border-radius: 14px;
}

.welcome-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--survey-text-muted);
}

.welcome-meta-item strong {
  color: var(--survey-primary);
}

/* QUESTION HEADER META */
.q-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.q-step-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--survey-primary);
}

.q-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--survey-primary);
  box-shadow: 0 0 10px var(--survey-primary);
}

.q-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: var(--survey-pill);
  background: rgba(0, 229, 212, 0.12);
  color: var(--survey-primary);
  border: 1px solid rgba(0, 229, 212, 0.3);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.q-required-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--survey-pill);
  background: rgba(244, 63, 94, 0.12);
  color: var(--survey-danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.q-optional-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--survey-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--survey-text-muted);
}

.q-title {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.45;
  color: var(--survey-text);
  margin-bottom: 8px;
}

.q-description {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--survey-text-muted);
  margin-bottom: 24px;
}

/* ERROR MESSAGE BANNER */
.q-error-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* OPTIONS LIST (MULTIPLE CHOICE) */
.survey-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.survey-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1.5px solid var(--survey-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.survey-option-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 229, 212, 0.4);
  transform: translateX(-4px);
}

.survey-option-card.selected {
  background: linear-gradient(135deg, rgba(0, 229, 212, 0.16) 0%, rgba(14, 165, 233, 0.09) 100%);
  border-color: var(--survey-primary);
  box-shadow: 0 4px 20px rgba(0, 229, 212, 0.28);
  transform: translateX(-4px) scale(1.01);
}

.survey-option-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.option-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--survey-border);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--survey-text-muted);
  transition: var(--survey-transition);
}

.survey-option-card.selected .option-key-badge {
  background: var(--survey-primary);
  color: #03080e;
  border-color: var(--survey-primary);
}

.option-label-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--survey-text);
  line-height: 1.5;
}

.option-shortcut-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  transition: var(--survey-transition);
}

.survey-option-card:hover .option-shortcut-hint {
  color: var(--survey-primary);
  border-color: rgba(0, 229, 212, 0.3);
}

.survey-option-card.selected .option-shortcut-hint {
  background: rgba(0, 229, 212, 0.2);
  color: #00e5d4;
  border-color: rgba(0, 229, 212, 0.4);
}

.option-check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--survey-transition);
}

.survey-option-card.selected .option-check-circle {
  border-color: var(--survey-primary);
  background: var(--survey-primary);
}

.option-check-circle svg {
  display: none;
  width: 12px;
  height: 12px;
  stroke: #03080e;
}

.survey-option-card.selected .option-check-circle svg {
  display: block;
}

/* YES / NO SPECIAL CARDS */
.survey-yesno-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.yesno-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px;
  gap: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1.5px solid var(--survey-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yesno-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.07);
}

.yesno-card.yes.selected {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  box-shadow: 0 4px 22px rgba(16, 185, 129, 0.35);
  transform: translateY(-3px) scale(1.02);
}

.yesno-card.no.selected {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  box-shadow: 0 4px 22px rgba(239, 68, 68, 0.35);
  transform: translateY(-3px) scale(1.02);
}

.yesno-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--survey-text);
}

/* RATING / SCALE 1 TO 5 */
.survey-scale-wrap {
  margin-bottom: 28px;
}

.scale-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scale-pill-btn {
  flex: 1;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--survey-border);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scale-pill-btn:hover {
  background: rgba(0, 229, 212, 0.1);
  border-color: var(--survey-primary);
  transform: translateY(-3px);
}

.scale-pill-btn.selected {
  background: var(--survey-primary);
  border-color: var(--survey-primary);
  color: #030712;
  box-shadow: 0 0 22px rgba(0, 229, 212, 0.5);
  transform: translateY(-3px) scale(1.06);
}

.scale-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--survey-text-muted);
  font-weight: 700;
}

/* TEXT & PHONE INPUTS */
.survey-input-box {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--survey-border);
  border-radius: 14px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  transition: var(--survey-transition);
  margin-bottom: 28px;
}

.survey-input-box:focus {
  border-color: var(--survey-primary);
  box-shadow: 0 0 20px var(--survey-primary-glow);
  background: rgba(255, 255, 255, 0.07);
}

.survey-textarea-box {
  min-height: 130px;
  resize: vertical;
  line-height: 1.8;
}

/* NAVIGATION BUTTONS & ACTIONS */
.survey-nav-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-survey-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: var(--survey-pill);
  background: linear-gradient(135deg, #00e5d4 0%, #0ea5e9 100%);
  color: #03080e;
  font-size: 0.96rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 229, 212, 0.4);
  transition: var(--survey-transition);
}

.btn-survey-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 229, 212, 0.6);
  filter: brightness(1.08);
}

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

.btn-survey-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--survey-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--survey-border);
  color: var(--survey-text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--survey-transition);
}

.btn-survey-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.survey-keyboard-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--survey-text-muted);
}

.kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #e2e8f0;
}

/* THANK YOU SCREEN */
.thankyou-box {
  text-align: center;
}

.thankyou-icon-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 24px auto;
  border-radius: 50%;
  background: rgba(0, 229, 212, 0.12);
  border: 2px solid var(--survey-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 229, 212, 0.4);
}

.thankyou-icon-wrap svg {
  width: 38px;
  height: 38px;
  stroke: var(--survey-primary);
}

.thankyou-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
}

.thankyou-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--survey-text-muted);
  margin-bottom: 28px;
}

.gift-voucher-box {
  background: rgba(0, 229, 212, 0.06);
  border: 1px dashed var(--survey-primary);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 30px;
}

.gift-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--survey-pill);
  background: rgba(0, 229, 212, 0.15);
  color: var(--survey-primary);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.gift-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.gift-code-text {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-copy-code {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--survey-primary);
  border: none;
  color: #03080e;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--survey-transition);
}

.btn-copy-code:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.gift-sub-desc {
  font-size: 0.84rem;
  color: var(--survey-text-muted);
}

/* RESPONSIVE DESIGN */
@media (max-width: 640px) {
  .survey-stage-card {
    padding: 26px 20px;
  }
  .q-title {
    font-size: 1.25rem;
  }
  .survey-topbar {
    padding: 0 16px;
  }
  .welcome-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .survey-keyboard-hint {
    display: none;
  }
  .survey-yesno-grid {
    grid-template-columns: 1fr;
  }
}
