/* Contains styles for form elements to match the mockup aesthetic. */

/* Global Checkbox Styling for Consistency */
input[type='checkbox'] {
  appearance: none;
  width: 1.25rem; /* Use rem for consistent sizing */
  height: 1.25rem; /* Use rem for consistent sizing */
  border: 2px solid var(--card-border);
  border-radius: 4px;
  /* margin-right: 0.75rem; Removed to close the gap */
  position: relative;
  cursor: pointer;
  vertical-align: middle; /* Helps align with label text */
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

input[type='checkbox']:checked {
  background-color: var(--highlight-color-bg);
  border-color: var(--highlight-color-bg);
}

input[type='checkbox']:checked::after {
  content: '✔';
  position: absolute;
  color: var(--highlight-color-fg);
  font-size: 1.2rem;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* General Form Group Styling */
form.container {
  margin: 0 auto; /* Ensure the form itself is centered */
  padding: 0; /* Remove container padding from the form element */
}

.form-grid-container {
  padding: 2rem; /* Apply internal padding here */
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color-bg);
}

/* Input, Select, and Textarea Styling */
.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='email'],
.form-group select,
.form-group textarea {
  width: 100%;
  /* max-width: 400px; REMOVED */
  padding: 0.85rem 1rem;
  border: 2px solid var(--accent-fg); /* Changed to Accent Color */
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-sans);
  background-color: var(--default-bg); /* Changed to default-bg */
  color: var(--default-fg); /* Changed to default-fg */
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box; /* Added to ensure padding fits */
}

.form-group input[type='text']:focus,
.form-group input[type='url']:focus,
.form-group input[type='email']:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--highlight-fg); /* Changed to Highlight Color */
  box-shadow: 0 0 0 3px var(--highlight-bg); /* Changed to Highlight BG */
}

.form-group textarea {
  min-height: 60px; /* Reduced height */
  resize: vertical;
}

/* Custom Select Arrow */
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem; /* Make space for the arrow */
}

/* Custom Checkbox Styling */
.form-group-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem; /* Reduced margin */
}

.form-group-checkbox label {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--foreground-color-fg);
  cursor: pointer;
  padding-left: 0.75rem; /* Added to push text right and extend clickable area */
}

.question-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.question-description {
  flex-grow: 1;
  text-align: left;
  color: var(--primary-color-bg);
  font-weight: 600;
}

/* Section Headers */
.form-grid-container h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color-bg);
  border-bottom: 1px solid var(--secondary-color-dk);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.form-group input[type='email'][disabled] {
  background-color: var(--secondary-color-lt);
  color: var(--secondary-color-dk);
  cursor: not-allowed;
}
