/* CSS Variables */
:root {
  --c-bg: #F5F7FA;
  --c-main: #0B2545;
  --c-accent: #1D81F2;
  --c-gold: #D4AF37;
  --font-head: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Watercolor texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(29, 129, 242, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(11, 37, 69, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Back Navigation */
.back-nav {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 100;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  background: white;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  border: 1px solid rgba(29, 129, 242, 0.1);
}

.back-link:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
  background: rgba(29, 129, 242, 0.05);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

/* Form Wrapper */
.form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .form-wrapper {
    padding: 5rem 1rem 3rem;
  }
}

/* Form Header */
.form-header {
  text-align: center;
  margin-bottom: 3rem;
  background: white;
  border-radius: 2rem;
  padding: 3rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(29, 129, 242, 0.1);
}

.header-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, var(--c-accent), var(--c-gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-lg);
}

.header-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.5px;
}

.form-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--c-main);
  margin-bottom: 1rem;
  font-family: var(--font-head);
  line-height: 1.2;
}

.form-subtitle {
  font-size: 1.25rem;
  color: rgba(11, 37, 69, 0.8);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.form-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(11, 37, 69, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
}

.info-item svg {
  width: 20px;
  height: 20px;
  color: var(--c-accent);
  stroke-width: 1.5px;
}

@media (max-width: 640px) {
  .form-title {
    font-size: 2rem;
  }
  
  .form-subtitle {
    font-size: 1.125rem;
  }
  
  .form-info {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Form Sections */
.diagnostic-form {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.form-section {
  background: white;
  border-radius: 2rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(11, 37, 69, 0.05);
  transition: all 0.3s ease;
}

.form-section:hover {
  box-shadow: var(--shadow-xl);
  border-color: rgba(29, 129, 242, 0.1);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--c-main);
  margin-bottom: 2rem;
  font-family: var(--font-head);
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(29, 129, 242, 0.1);
}

.section-number {
  background: linear-gradient(135deg, var(--c-accent), var(--c-gold));
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

/* Form Groups */
.form-group {
  margin-bottom: 2rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--c-main);
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  line-height: 1.4;
}

.required-indicator {
  color: #EF4444;
  margin-left: 0.25rem;
}

/* Form Inputs */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid rgba(11, 37, 69, 0.1);
  border-radius: 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: white;
  color: var(--c-main);
  transition: all 0.3s ease;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(29, 129, 242, 0.1);
  background: rgba(29, 129, 242, 0.02);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(11, 37, 69, 0.5);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5rem;
  padding-right: 3rem;
  appearance: none;
}

.form-textarea {
  min-height: 120px;
  line-height: 1.6;
}

/* Form Help Text */
.form-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgba(11, 37, 69, 0.6);
  line-height: 1.4;
}

/* Submit Section */
.form-submit {
  background: white;
  border-radius: 2rem;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(29, 129, 242, 0.1);
  text-align: center;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--c-accent), var(--c-gold));
  color: white;
  border: none;
  padding: 1.25rem 3rem;
  border-radius: 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.submit-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.submit-button:hover:not(:disabled)::before {
  left: 100%;
}

.submit-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2px;
}

.submit-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

.submit-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: rgba(11, 37, 69, 0.6);
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-section {
    padding: 2rem 1.5rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .section-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .form-label {
    font-size: 1rem;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    padding: 0.875rem 1rem;
  }
  
  .submit-button {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
  }
  
  .form-submit {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .form-wrapper {
    padding: 4rem 0.75rem 2rem;
  }
  
  .form-header {
    padding: 2rem 1.5rem;
  }
  
  .form-section {
    padding: 1.5rem 1rem;
  }
  
  .back-nav {
    top: 1rem;
    left: 1rem;
  }
  
  .back-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.submit-button:focus,
.back-link:focus {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input,
  .form-select,
  .form-textarea {
    border-width: 3px;
  }
  
  .form-section {
    border-width: 2px;
  }
}