/* DevUps Survey Styles - Matching DevUps Brand */

/* CSS Variables - DevUps Theme */
:root {
  /* Dark mode (default) */
  --background: hsl(230, 10%, 8%);
  --foreground: hsl(0, 0%, 95%);
  --muted: hsl(240, 3.7%, 15.9%);
  --muted-foreground: hsl(240, 5%, 64.9%);
  --card: hsl(240, 10%, 12%);
  --card-foreground: hsl(0, 0%, 95%);
  --border: hsl(215, 70%, 31%);
  --input: hsl(240, 3.7%, 15.9%);
  --primary: hsl(215, 100%, 31%);
  --primary-foreground: hsl(0, 0%, 95%);
  --secondary: hsl(240, 3.7%, 15.9%);
  --orange-brand: hsl(25, 100%, 50%);
  --ring: hsl(180, 100%, 50%);
  --radius: 0.5rem;

  /* Spacing */
  --header-height: 64px;
  --progress-height: 48px;
}

.light {
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(229, 84%, 10%);
  --muted: hsl(0, 0%, 96%);
  --muted-foreground: hsl(229, 84%, 20%);
  --card: hsl(0, 0%, 98%);
  --card-foreground: hsl(229, 84%, 10%);
  --border: hsl(215, 100%, 31%);
  --input: hsl(0, 0%, 92%);
  --primary: hsl(215, 100%, 31%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(0, 0%, 90%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--background);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--foreground);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 36px;
  object-fit: contain;
}

/* Logo theme switching - dark logo shown by default, light logo hidden */
.logo-dark {
  display: block;
}

.logo-light {
  display: none;
}

/* In light mode, show light logo and hide dark logo */
.light .logo-dark {
  display: none;
}

.light .logo-light {
  display: block;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.time-estimate {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding: 0.375rem 0.75rem;
  background: var(--muted);
  border-radius: 9999px;
}

.theme-toggle {
  background: var(--muted);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: var(--secondary);
  transform: scale(1.05);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

.light .theme-toggle .sun-icon {
  display: none;
}

.light .theme-toggle .moon-icon {
  display: block;
}

/* Progress Bar */
.progress-container {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--progress-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-bar {
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Main Content */
.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--progress-height) + 2rem) 1.5rem 2rem;
}

/* Intro Section */
.intro-section {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.intro-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--orange-brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-section h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.intro-section .subtitle {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.info-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: left;
}

.info-card svg {
  flex-shrink: 0;
  color: var(--primary);
}

/* Form Sections */
.form-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  min-width: 48px;
}

.section-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.section-header p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Question Blocks */
.question-block {
  margin-bottom: 2rem;
}

.question-label {
  display: block;
  font-weight: 500;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.question-number {
  color: var(--primary);
  font-weight: 600;
  margin-right: 0.5rem;
}

.multi-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-top: 0.25rem;
}

.question-hint {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  font-style: italic;
}

/* Text Inputs */
.text-input,
.textarea-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--foreground);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(215, 100%, 31%, 0.2);
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: var(--muted-foreground);
}

.textarea-input {
  resize: vertical;
  min-height: 80px;
}

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.sub-fields {
  padding-left: 0;
}

.sub-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.checkbox-group.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.checkbox-group.inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--input);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.checkbox-option.small {
  padding: 0.5rem 0.75rem;
}

.radio-option:hover,
.checkbox-option:hover {
  background: var(--muted);
}

.radio-option input,
.checkbox-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-custom,
.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted-foreground);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.checkbox-custom {
  border-radius: 4px;
}

.radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s, transform 0.2s;
}

.checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.radio-option input:checked + .radio-custom,
.checkbox-option input:checked + .checkbox-custom {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-option input:checked + .radio-custom::after {
  opacity: 1;
  transform: scale(1);
  background: var(--primary-foreground);
}

.checkbox-option input:checked + .checkbox-custom::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.radio-option input:checked ~ .radio-text,
.checkbox-option input:checked ~ .checkbox-text {
  color: var(--foreground);
}

.radio-text,
.checkbox-text {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  transition: color 0.2s;
}

/* Card Style Options */
.radio-group.cards {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.radio-group.cards.budget {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.radio-option.card {
  flex: 1;
  min-width: 120px;
  padding: 1rem;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.radio-option.card .radio-custom {
  display: none;
}

.radio-option.card .card-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.radio-option.card .card-title {
  font-weight: 600;
  color: var(--foreground);
}

.radio-option.card .card-desc {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.radio-option.card input:checked ~ .card-content .card-title {
  color: var(--primary);
}

.radio-option.card input:checked {
  border-color: var(--primary);
}

.radio-option.card:has(input:checked) {
  border-color: var(--primary);
  background: hsla(215, 100%, 31%, 0.1);
}

/* Navigation */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

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

.nav-btn.prev {
  background: var(--secondary);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.nav-btn.prev:not(:disabled):hover {
  background: var(--muted);
}

.nav-btn.next,
.nav-btn.submit {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  margin-left: auto;
}

.nav-btn.next:not(:disabled):hover,
.nav-btn.submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsla(215, 100%, 31%, 0.3);
}

.nav-btn.submit {
  background: linear-gradient(135deg, var(--primary) 0%, var(--orange-brand) 100%);
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 3rem 1.5rem;
}

.success-content {
  max-width: 400px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: hsla(142, 76%, 36%, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(142, 76%, 36%);
}

.success-message h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.success-message p {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.back-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsla(215, 100%, 31%, 0.3);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Hidden sections for step-by-step */
.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
  .intro-section h1 {
    font-size: 2rem;
  }

  .section-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .section-number {
    font-size: 1.5rem;
  }

  .checkbox-group.grid-2 {
    grid-template-columns: 1fr;
  }

  .radio-group.cards {
    flex-direction: column;
  }

  .radio-group.cards.budget {
    grid-template-columns: 1fr 1fr;
  }

  .form-navigation {
    flex-wrap: wrap;
  }

  .nav-btn {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }

  .nav-btn.submit {
    flex-basis: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 1rem;
  }

  .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .time-estimate {
    display: none;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .radio-group.cards.budget {
    grid-template-columns: 1fr;
  }

  .checkbox-group.inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Intro Screen */
.intro-screen {
  text-align: center;
  padding: 3rem 1.5rem;
  min-height: calc(100vh - var(--header-height) - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.intro-logo {
  margin-bottom: 2rem;
  color: var(--primary);
}

.intro-logo img {
  height: 80px;
  object-fit: contain;
}

.intro-screen h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--orange-brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-screen h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.intro-screen .subtitle {
  color: var(--muted-foreground);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.intro-screen .info-cards {
  margin-bottom: 2.5rem;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--orange-brand) 100%);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px hsla(215, 100%, 31%, 0.3);
}

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

/* Required Field Indicators */
.required-hint {
  color: hsl(0, 84%, 60%);
  font-weight: 600;
  margin-left: 0.25rem;
}

.optional-hint {
  color: var(--muted-foreground);
  font-weight: 400;
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

/* Validation Error Styles */
.error-message {
  color: hsl(0, 84%, 60%);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.error-message::before {
  content: '⚠';
}

.question-block.has-error {
  border-left: 3px solid hsl(0, 84%, 60%);
  padding-left: 1rem;
  margin-left: -1rem;
}

.input-error {
  border-color: hsl(0, 84%, 60%) !important;
}

.input-error:focus {
  border-color: hsl(0, 84%, 60%) !important;
  box-shadow: 0 0 0 2px hsla(0, 84%, 60%, 0.2) !important;
}

/* Print Styles */
@media print {
  .header,
  .progress-container,
  .form-navigation,
  .theme-toggle {
    display: none !important;
  }

  .main-content {
    padding-top: 1rem;
  }

  .form-section {
    display: block !important;
    break-inside: avoid;
  }

  .question-block {
    break-inside: avoid;
  }
}

