@use 'ui-design-system/src/styles/semantic/index' as *;

.contact-form {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;

  &__header {
    text-align: center;
    margin-bottom: 3rem;
  }

  &__title {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
  }

  &__description {
    font-size: 1.25rem;
    color: #6b7280;
    line-height: 1.5;
  }

  &__success {
    padding: 2rem;
  }

  &__form {
    display: grid;
    gap: 2rem;

    &--single-column {
      grid-template-columns: 1fr;
    }

    &--two-column {
      grid-template-columns: 1fr 1fr;
      
      @media (max-width: 768px) {
        grid-template-columns: 1fr;
      }
    }

    &--inline {
      display: flex;
      flex-wrap: wrap;
      gap: 1.5rem;
      align-items: flex-end;

      @media (max-width: 768px) {
        flex-direction: column;
        align-items: stretch;
      }
    }
  }

  &__submit {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
  }

  &__button {
    min-width: 160px;
  }
}

.success-message {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;

  &__icon {
    width: 32px;
    height: 32px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
  }

  &__text {
    color: #166534;
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.4;
  }
}

.form-field {
  &--full-width {
    grid-column: 1 / -1;
  }

  &--checkbox {
    grid-column: 1 / -1;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  &__label {
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  &__required {
    color: #dc2626;
    font-weight: bold;
  }

  &__input,
  &__textarea,
  &__select {
    padding: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s;
    outline: none;

    &:focus {
      border-color: #3b82f6;
    }

    &::placeholder {
      color: #9ca3af;
    }

    &--error {
      border-color: #dc2626;
      
      &:focus {
        border-color: #dc2626;
      }
    }
  }

  &__textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
  }

  &__select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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: 16px;
    padding-right: 3rem;
    appearance: none;
  }

  &__error {
    font-size: 0.875rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    &::before {
      content: '⚠';
      font-size: 14px;
    }
  }
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  &__label {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
  }

  &__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;

    &:checked + .checkbox-group__checkmark {
      background-color: #3b82f6;
      border-color: #3b82f6;

      &::after {
        opacity: 1;
        transform: scale(1);
      }
    }
  }

  &__checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background: #ffffff;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 2px;

    &::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 50%;
      width: 6px;
      height: 10px;
      border: solid white;
      border-width: 0 2px 2px 0;
      transform: translate(-50%, -60%) rotate(45deg) scale(0);
      opacity: 0;
      transition: all 0.2s;
    }
  }

  &__text {
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.5;
  }

  &__required {
    color: #dc2626;
    font-weight: bold;
    margin-left: 0.25rem;
  }

  &__error {
    font-size: 0.875rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 32px;

    &::before {
      content: '⚠';
      font-size: 14px;
    }
  }
}