/**
 * Data Entry Gate Styles
 * Pre-assessment demographic data collection form
 * Uses brand variables from brand-variables.css
 */

/* ============================================ */
/* BASE */
/* ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  background: #21251f;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

/* ============================================ */
/* CONTAINER & LAYOUT */
/* ============================================ */

.deg-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 40px 20px;
  font-family: var(--font-sans);
}

/* ============================================ */
/* HEADER */
/* ============================================ */

.deg-header {
  text-align: center;
  margin-bottom: 40px;
}

.deg-header h1 {
  font-size: var(--text-3xl);
  color: var(--brand-sage);
  margin-bottom: 10px;
  font-weight: var(--font-bold);
}

.deg-subtitle {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

.deg-deliverables {
  font-size: var(--text-sm);
  color: var(--brand-sage);
  margin-top: 10px;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

/* ============================================ */
/* FORM SECTIONS */
/* ============================================ */

.deg-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.deg-form-section h2 {
  font-size: var(--text-xl);
  color: var(--brand-sage);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--brand-sage);
  padding-bottom: 10px;
  font-weight: var(--font-semibold);
}

.deg-section-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: var(--leading-relaxed);
}

/* ============================================ */
/* FORM GROUPS */
/* ============================================ */

.deg-form-group {
  margin-bottom: 20px;
}

.deg-form-group label {
  display: block;
  font-weight: var(--font-semibold);
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.deg-required {
  color: var(--accent-sage-red);
  margin-left: 4px;
}

/* ============================================ */
/* INPUT STYLES */
/* ============================================ */

.deg-input,
.deg-select {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: rgba(45, 50, 47, 0.6);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.deg-input:hover,
.deg-select:hover {
  border-color: var(--brand-sage);
  background-color: rgba(45, 50, 47, 0.8);
}

.deg-input:focus,
.deg-select:focus {
  outline: none;
  border-color: var(--brand-sage);
  box-shadow: var(--shadow-focus-sage);
  background-color: rgba(45, 50, 47, 0.9);
}

.deg-input:invalid,
.deg-select:invalid {
  border-color: var(--accent-sage-red);
}

/* Dropdown specific styles */
.deg-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ba3a0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.deg-select option {
  background-color: #2d3330;
  color: var(--text-primary);
  padding: 8px;
}

/* ============================================ */
/* RADIO BUTTON GROUP */
/* ============================================ */

.deg-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deg-radio-group label {
  display: flex;
  align-items: center;
  font-weight: var(--font-normal);
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  background-color: rgba(45, 50, 47, 0.4);
}

.deg-radio-group label:hover {
  background-color: rgba(45, 50, 47, 0.6);
  border-color: var(--brand-sage);
}

.deg-radio-group input[type="radio"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-sage);
}

.deg-radio-group input[type="radio"]:checked + span {
  font-weight: var(--font-medium);
}

/* Make the label span take full width */
.deg-radio-group label span {
  flex: 1;
}

/* ============================================ */
/* HELPER TEXT */
/* ============================================ */

.deg-helper-text {
  display: block;
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.deg-helper-text strong {
  color: var(--brand-sage);
  font-weight: var(--font-semibold);
}

/* ============================================ */
/* PRIVACY NOTICE */
/* ============================================ */

.deg-privacy-notice {
  background: rgba(155, 163, 160, 0.1);
  border-left: 4px solid var(--brand-sage);
  padding: 16px 20px;
  margin-bottom: 30px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.deg-privacy-notice p {
  margin: 0;
  color: var(--text-tertiary);
}

.deg-privacy-notice strong {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

/* ============================================ */
/* SUBMIT BUTTON */
/* ============================================ */

.deg-btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: white;
  background: var(--brand-sage);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--shadow-btn-default);
  font-family: var(--font-sans);
}

.deg-btn-primary:hover {
  background: var(--sage-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

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

.deg-btn-primary:disabled {
  background: rgba(155, 163, 160, 0.4);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================ */
/* CONDITIONAL FIELDS (Hidden by default) */
/* ============================================ */

.deg-conditional-hidden {
  display: none;
}

/* ============================================ */
/* LOADING STATE */
/* ============================================ */

.deg-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: deg-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes deg-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================ */
/* ERROR MESSAGES */
/* ============================================ */

.deg-error-message {
  display: none;
  padding: 12px 16px;
  background: rgba(168, 136, 136, 0.15);
  border: 2px solid var(--accent-sage-red);
  border-radius: var(--radius-md);
  color: var(--accent-sage-red);
  margin-bottom: 20px;
  font-size: var(--text-sm);
}

.deg-error-message.active {
  display: block;
}

.deg-error-message strong {
  font-weight: var(--font-semibold);
}

/* Field-level error state */
.deg-form-group.error .deg-input,
.deg-form-group.error .deg-select {
  border-color: var(--accent-sage-red);
}

.deg-form-group.error .deg-helper-text {
  color: var(--accent-sage-red);
}

/* ============================================ */
/* MOBILE RESPONSIVE */
/* ============================================ */

@media (max-width: 640px) {
  .deg-container {
    padding: 20px 15px;
  }

  .deg-form-section {
    padding: 20px;
  }

  .deg-header h1 {
    font-size: var(--text-2xl);
  }

  .deg-subtitle {
    font-size: var(--text-base);
  }

  .deg-form-section h2 {
    font-size: var(--text-lg);
  }

  .deg-btn-primary {
    padding: 14px 20px;
    font-size: var(--text-base);
  }

  .deg-radio-group label {
    padding: 10px 12px;
  }
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

/* Focus visible for keyboard navigation */
.deg-input:focus-visible,
.deg-select:focus-visible,
.deg-btn-primary:focus-visible,
.deg-radio-group input[type="radio"]:focus-visible {
  outline: 2px solid var(--brand-sage);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .deg-btn-primary,
  .deg-input,
  .deg-select,
  .deg-radio-group label {
    transition: none;
  }

  .deg-loading {
    animation: none;
    border-top-color: var(--brand-sage);
  }
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
  .deg-btn-primary {
    display: none;
  }

  .deg-privacy-notice {
    border: 1px solid #000;
    background: #fff;
  }
}
