.apply-lead {
  max-width: 40rem;
  color: hsl(var(--muted-foreground));
}

.apply-form {
  max-width: 48rem;
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
}
.apply-form fieldset {
  margin: 0;
  padding: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background: hsl(var(--muted));
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
}
.apply-form legend {
  float: left;
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 0.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.deal {
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background: hsl(var(--muted));
}
.deal summary {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.deal summary::-webkit-details-marker {
  display: none;
}
.deal summary::after {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  background: hsl(var(--primary));
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: rotate 0.2s;
}
.deal[open] summary::after {
  rotate: 180deg;
}
.optional {
  font-size: 0.8rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}
.deal-fields {
  padding: 0 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
}
.field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}
.field.wide,
.hint.wide {
  grid-column: 1 / -1;
}
.field label,
.field .label {
  font-size: 0.9rem;
  font-weight: 500;
}
.hint {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}
.apply-form input:not([type='checkbox'], [type='radio']),
.apply-form select,
.apply-form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font: inherit;
}
.apply-form textarea {
  resize: vertical;
}
.apply-form input[type='file'] {
  padding: 0.4rem;
  cursor: pointer;
}
.apply-form input[type='file']::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: calc(var(--radius) - 0.25rem);
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.select {
  position: relative;
  display: block;
}
.select select {
  appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
}
.select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.875rem;
  width: 1.25rem;
  height: 1.25rem;
  translate: 0 -50%;
  background: hsl(var(--primary));
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  pointer-events: none;
}
.apply-form :is(input, select, textarea):focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 0;
}
.apply-form :is(input, select, textarea)[aria-invalid='true'] {
  border-color: hsl(var(--destructive));
}
.field-error {
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--destructive));
}
.apply-form input[type='checkbox'],
.apply-form input[type='radio'] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: hsl(var(--primary));
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  font-weight: 400;
  cursor: pointer;
}
.choices label:has(input:checked) {
  border-color: hsl(var(--border-colored));
  background: hsl(var(--secondary));
}
.consents {
  display: grid;
  gap: 0.75rem;
}
.consents.wide {
  grid-column: 1 / -1;
}
.photo-tips {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}
.consents label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.consents input {
  margin-top: 0.2rem;
}
.apply-form > .button {
  justify-self: start;
  min-height: 3.25rem;
}
.apply-form .form-message {
  color: hsl(var(--foreground));
}

@media (max-width: 34rem) {
  .apply-form fieldset,
  .deal-fields {
    grid-template-columns: 1fr;
  }
  .apply-form fieldset,
  .deal summary {
    padding: 1.25rem 1rem;
  }
  .deal-fields {
    padding: 0 1rem 1.25rem;
  }
  .apply-form > .button {
    justify-self: stretch;
  }
}
