@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --secondary: #6366f1;
  --accent: #0ea5e9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #dc2626;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --glow-primary: rgba(16, 185, 129, 0.3);
  --glow-secondary: rgba(99, 102, 241, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* DNA Spiral Background */
.dna-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  perspective: 1000px;
}

/* DNA Helix Container - Takes up left half */
.dna-helix {
  position: absolute;
  left: -10%;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: dnaRotate 20s linear infinite;
}

/* Each base pair row */
.dna-pair {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30vw;
  transform-style: preserve-3d;
  /* Position each pair vertically - extends beyond viewport (overflow) */
  top: calc(-15% + var(--i) * 6.5%);
  transform: rotateY(calc(var(--i) * 18deg));
}

/* The nucleotide balls on each end */
.dna-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ball-left {
  background: radial-gradient(circle at 30% 30%, #34d399, #10b981);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
}

.ball-right {
  background: radial-gradient(circle at 30% 30%, #5eead4, #14b8a6);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.7);
}

/* The connecting bar (base pair) */
.dna-bar {
  width: calc(30vw - 56px);
  height: 10px;
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.9) 0%,
    rgba(13, 148, 136, 0.7) 50%,
    rgba(20, 184, 166, 0.9) 100%
  );
  border-radius: 5px;
}

/* Main rotation animation */
@keyframes dnaRotate {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* Mobile - Adjust size and simplify */
@media (max-width: 768px) {
  .dna-background {
    perspective: 600px;
  }

  .dna-helix {
    width: 50%;
    animation-duration: 20s;
    left: -15% !important;
  }

  .dna-pair {
    width: 45vw;
    /* Extends beyond viewport (overflow top and bottom) */
    top: calc(-20% + var(--i) * 6.5%) !important;
  }

  .dna-ball {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  }

  .ball-right {
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.6);
  }

  .dna-bar {
    width: calc(45vw - 40px);
    height: 8px;
  }

  /* Show all 20 pairs on mobile with tighter spacing */
  /* No hiding needed - all pairs visible */
}

.app-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.header {
  text-align: center;
  margin: 0 auto 40px auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInDown 0.8s ease-out;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px auto;
  width: 100%;
}

.logo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin: 0;
  padding: 0;
  text-align: center;
}

/* PDF Export Button - Top Right */
.pdf-export-top {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 1000;
  opacity: 0;
  animation: slideInRight 0.6s ease-out 0.5s forwards;
}

.export-pdf-btn {
  background: var(--success);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.export-pdf-btn:hover {
  background: #16a34a;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Main Card */
.card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

/* Progress Bar */
.progress-container {
  background: var(--bg-secondary);
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 10px;
}

.progress-line {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  z-index: 0;
  overflow: hidden;
}

.progress-line-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.step {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 3px solid rgba(148, 163, 184, 0.3);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step.completed .step-circle::after {
  content: '✓';
  position: absolute;
  font-size: 1.2rem;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

/* Form Content */
.form-content {
  padding: 50px 40px;
  min-height: 550px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.step-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 35px;
}

.form-group {
  margin-bottom: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

label .required {
  color: var(--danger);
  margin-left: 4px;
}

label .optional {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 6px;
  opacity: 0.7;
}

/* Form Input Styling */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #0f172a;
  transition: border-color 0.2s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--primary-light);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2310b981' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  background-color: #0f172a;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Unit toggle for height/weight */
.unit-toggle {
  margin-bottom: 10px;
}

.unit-toggle select {
  width: auto;
  min-width: 150px;
}

.height-input,
.weight-input {
  margin-top: 8px;
}

.height-input .form-row {
  gap: 10px;
}

/* Disease Cards */
.disease-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.disease-card {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.disease-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.disease-card.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  border-width: 2px;
}

.disease-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.disease-card .inheritance-type {
  font-size: 0.85rem;
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

.disease-card.selected .inheritance-type {
  opacity: 1;
  font-weight: 600;
}

/* Family Member Card */
.family-member {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.family-member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.family-member-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Remove Button */
.remove-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.2s ease;
  font-weight: 500;
  width: auto;
  max-width: 70px;
  flex-shrink: 0;
  white-space: nowrap;
}

.remove-btn:hover {
  background: #b91c1c;
}

.add-family-btn {
  background: #0f172a;
  color: var(--primary);
  border: 2px dashed var(--primary);
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-size: 0.95rem;
}

.add-family-btn:hover {
  background: var(--primary);
  color: white;
  border-style: solid;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 16px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

button {
  flex: 1;
  padding: 16px 28px;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.btn-secondary {
  background: #0f172a;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Results Container */
.results-container {
  display: none;
}

.results-container.active {
  display: block;
  animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.results-header {
  background: var(--primary);
  color: white;
  padding: 40px;
  text-align: center;
}

.results-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.risk-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  margin: 20px 0;
}

.risk-category {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.2);
}

.results-body {
  padding: 40px;
}

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

.result-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-section h3::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
}

.info-card {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.info-card h4 {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.info-card p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.comparison-bar {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.bar-container {
  height: 28px;
  background: #334155;
  border-radius: 6px;
  position: relative;
  margin-top: 12px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  transition: width 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

.bar-label {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.factor-list {
  list-style: none;
}

.factor-item {
  background: #0f172a;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}

.factor-name {
  font-weight: 600;
  color: var(--text-primary);
}

.factor-impact {
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.impact-high {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.impact-moderate {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.impact-low {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.recommendations {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--primary-light);
  border-radius: 8px;
  padding: 24px;
}

.recommendations ul {
  margin-top: 15px;
  padding-left: 28px;
}

.recommendations li {
  margin-bottom: 14px;
  color: var(--text-primary);
  line-height: 1.8;
}

.disclaimer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  border-left: 5px solid var(--warning);
  padding: 24px;
  border-radius: 16px;
  margin-top: 40px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.disclaimer h4 {
  color: #fbbf24;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.disclaimer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.restart-btn,
.action-buttons button {
  width: 100%;
  margin-top: 28px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}

.action-buttons .restart-btn {
  max-width: 400px;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .app-container {
    padding: 20px 10px;
  }

  .pdf-export-top {
    top: 15px;
    right: 15px;
  }

  .export-pdf-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .export-pdf-btn span {
    display: none;
  }

  .header {
    margin: 0 auto 30px auto;
    width: 100%;
  }

  .logo-container {
    gap: 15px;
    width: 100%;
    margin: 0 auto 15px auto;
  }

  .logo {
    width: 65px;
    height: 65px;
  }

  .header h1 {
    font-size: 2.2rem;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
  }

  .header .tagline {
    font-size: 0.95rem;
    text-align: center;
    width: 100%;
    padding: 0 10px;
  }

  .form-content {
    padding: 35px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .family-member-header {
    gap: 20px;
  }

  .remove-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-left: auto;
  }

  .step-label {
    font-size: 0.7rem;
  }

  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .risk-score {
    font-size: 3.5rem;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .step-title {
    font-size: 1.6rem;
  }

  .progress-container {
    padding: 24px 20px;
  }

  .progress-line {
    top: 18px;
  }

  .results-body {
    padding: 28px 24px;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

/* SVG Gradient Definitions */
svg defs {
  display: none;
}

/* Error Container */
.error-container {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
  border: 2px solid rgba(239, 68, 68, 0.5);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #fca5a5;
  font-weight: 500;
  display: none;
  animation: shakeError 0.5s ease-in-out;
}

.error-container.show {
  display: block;
}

.error-container ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.error-container li {
  margin-bottom: 4px;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Field Hints */
.field-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
  opacity: 0.8;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: var(--text-primary);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(13, 148, 136, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Button Loading State */
.btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-primary.loading .btn-loading {
  display: inline-flex;
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.disease-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(13, 148, 136, 0.3);
}

/* Step buttons */
button.step {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  outline: none;
  font: inherit;
  color: inherit;
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

button.step:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.step:not(:disabled) {
  cursor: pointer;
}

button.step.completed:hover .step-circle {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}

button.step:focus-visible {
  outline: none;
}

button.step:focus-visible .step-circle {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Form field error states */
.form-group.has-error input,
.form-group.has-error select {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-group .field-error {
  color: #fca5a5;
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}

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

/* Pause animations when page not visible (performance) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Tooltip Styles */
.tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-secondary);
}

.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: 250px;
  white-space: normal;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.tooltip-trigger:hover::after,
.tooltip-trigger:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Success Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}
