/**
 * ICBS Student Future Study Survey
 * GenZ Light Theme Design System
 */

:root {
  /* Color Palette - Vibrant GenZ Pastel & Neo-Gradients */
  --bg-base: #f8fafc;
  --bg-gradient-1: #e0e7ff;
  --bg-gradient-2: #fce7f3;
  --bg-gradient-3: #ccfbf1;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(226, 232, 240, 0.8);
  --card-hover-border: #818cf8;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --success: #10b981;
  --success-light: #d1fae5;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 30px -10px rgba(99, 102, 241, 0.12);
  --shadow-lg: 0 25px 50px -12px rgba(99, 102, 241, 0.18);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Animated Gradient Background */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.65;
  border-radius: 50%;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #c7d2fe 0%, #a5b4fc 70%);
  top: -100px;
  left: -50px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #fbcfe8 0%, #f472b6 70%);
  bottom: 5%;
  right: -100px;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #a7f3d0 0%, #6ee7b7 70%);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.08); }
  100% { transform: translate(-30px, -40px) scale(0.95); }
}

/* Container */
.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* Header & Branding */
.survey-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 25px -6px rgba(99, 102, 241, 0.14);
  margin-bottom: 16px;
  transition: var(--bounce);
}

.logo-container:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.2);
}

.brand-logo-img {
  height: 68px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pill span.dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.survey-title {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 10px;
}

.title-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #ec4899 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.survey-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* Progress Tracker Bar */
.progress-container {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 140px;
}

.progress-track {
  flex-grow: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #ec4899, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Form Card */
.survey-form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* Section Cards */
.form-section {
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px dashed #e2e8f0;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
  padding-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.section-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.section-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-title-wrap p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Form Grid & Fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .required-star {
  color: var(--accent-pink);
  margin-left: 4px;
}

.form-label .helper-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Inputs, Selects & Textareas */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  font-size: 1.1rem;
  color: var(--text-light);
  pointer-events: none;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.input-wrap .form-input {
  padding-left: 46px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: #ffffff;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 42px;
  cursor: pointer;
}

.input-error-msg {
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 500;
  display: none;
  margin-top: 2px;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select {
  border-color: var(--danger);
  background: #fff5f5;
}

.form-group.has-error .input-error-msg {
  display: block;
}

/* Custom Interactive Choice Grid (Pill Radios) */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.choice-grid.four-cols {
  grid-template-columns: repeat(4, 1fr);
}

.choice-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

.choice-card {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  background: #ffffff;
  transition: var(--bounce);
  min-height: 90px;
  gap: 6px;
}

.choice-card-icon {
  font-size: 1.6rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

.choice-card:hover .choice-card-content {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.choice-card:hover .choice-card-icon {
  transform: scale(1.15);
}

/* Checked Choice Card Style */
.choice-card input[type="radio"]:checked + .choice-card-content {
  border-color: var(--primary);
  background: linear-gradient(145deg, #ffffff, var(--primary-light));
  box-shadow: 0 8px 20px -6px var(--primary-glow);
  transform: translateY(-3px);
}

.choice-card input[type="radio"]:checked + .choice-card-content .choice-card-title {
  color: var(--primary-hover);
  font-weight: 700;
}

/* Dynamic Country Tags / Multi-choice Selector */
.country-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.country-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: var(--bounce);
  user-select: none;
}

.country-tag input[type="checkbox"] {
  display: none;
}

.country-tag:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.country-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: scale(1.03);
}

/* Conditional Field Reveal Animations */
.conditional-field {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  animation: fadeIn 0.35s ease forwards;
}

.conditional-field.is-visible {
  display: block;
}

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

/* Submit Action Button */
.form-actions {
  margin-top: 32px;
  text-align: center;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  padding: 18px 36px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: var(--bounce);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 18px 35px -6px rgba(99, 102, 241, 0.5);
}

.btn-submit:active {
  transform: translateY(0) scale(0.98);
}

.btn-submit .btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-spinner {
  display: inline-block;
}

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

/* Guarantee & Security note */
.form-footer-note {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Success Modal / Screen */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
  animation: heartBeat 1.2s infinite;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.1); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.modal-message {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  padding: 13px 24px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full);
  color: #334155;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .container {
    padding: 20px 14px 40px;
  }
  
  .survey-title {
    font-size: 1.85rem;
  }

  .survey-form-card {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

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

  .choice-grid.four-cols, .choice-grid.three-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-submit {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .choice-grid.four-cols, .choice-grid.three-cols {
    grid-template-columns: 1fr;
  }
}
