
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@import url("https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap");

body {
  font-family: "Karla", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: hsl(187, 24%, 22%);
  background-color: hsl(148, 38%, 91%);
  min-height: 100vh;
  padding: 1.5rem;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-container {
  background-color: hsl(0, 0%, 100%);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  padding: 3rem;
  width: 100%;
  max-width: 600px;
  position: relative;
  margin: 0 auto;
}

.form-title {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(187, 24%, 22%);
  margin-bottom: 2rem;
  text-align: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-label {
  font-size: 16px;
  font-weight: 400;
  color: hsl(187, 24%, 22%);
  display: block;
}

.required {
  color: hsl(0, 66%, 54%);
  font-weight: 700;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 5px;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  color: hsl(187, 24%, 22%);
  background-color: hsl(0, 0%, 100%);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(169, 82%, 27%);
  box-shadow: 0 0 0 3px rgba(25, 113, 194, 0.1);
}

.form-input:hover,
.form-textarea:hover {
  border-color: hsl(169, 82%, 27%);
}

.form-input.error,
.form-textarea.error {
  border-color: hsl(0, 66%, 54%);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.radio-option {
  position: relative;
}

.radio-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  font-size: 16px;
  color: hsl(187, 24%, 22%);
  justify-content: flex-start;
}

.radio-label:hover {
  border-color: hsl(169, 82%, 27%);
  background-color: hsl(148, 38%, 91%);
}

.radio-input:focus + .radio-label {
  outline: 2px solid hsl(169, 82%, 27%);
  outline-offset: 2px;
}

.radio-input:checked + .radio-label {
  border-color: hsl(169, 82%, 27%);
  background-color: hsl(148, 38%, 91%);
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.3s ease;
}

.radio-input:checked + .radio-label .radio-custom {
  border-color: hsl(169, 82%, 27%);
}

.radio-input:checked + .radio-label .radio-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: hsl(169, 82%, 27%);
  border-radius: 50%;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  font-size: 16px;
  color: hsl(187, 24%, 22%);
  line-height: 1.4;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 5px;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.checkbox-input:checked + .checkbox-label .checkbox-custom {
  border-color: hsl(169, 82%, 27%);
  background-color: hsl(169, 82%, 27%);
}

.checkbox-input:checked + .checkbox-label .checkbox-custom::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: solid hsl(0, 0%, 100%);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-input:focus + .checkbox-label {
  outline: 2px solid hsl(169, 82%, 27%);
  outline-offset: 2px;
}

.error-message {
  color: hsl(0, 66%, 54%);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.error-message.show {
  display: block;
}

.submit-btn {
  background-color: hsl(169, 82%, 27%);
  color: hsl(0, 0%, 100%);
  border: none;
  border-radius: 5px;
  padding: 1rem 2rem;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 1rem;
}

.submit-btn:hover {
  background-color: hsl(169, 82%, 22%);
  transform: translateY(-1px);
}

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

.submit-btn:focus {
  outline: 2px solid hsl(169, 82%, 27%);
  outline-offset: 2px;
}

.success-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  text-align: center;
  padding: 3rem;
  background-color: hsl(169, 82%, 27%);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  display: none;
  min-width: 300px;
  max-width: 90vw;
}

.success-message.show {
  display: block;
}

.success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: hsl(0, 0%, 100%);
}

.success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(0, 0%, 100%);
  margin-bottom: 0.5rem;
}

.success-text {
  color: hsl(0, 0%, 100%);
  font-size: 16px;
}

/* Overlay for success message */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.success-overlay.show {
  display: block;
}

@media (max-width: 768px) {
  .form-container {
    padding: 2rem;
    margin: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-title {
    font-size: 1.5rem;
  }

  .radio-group {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .radio-label {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem;
  }

  .form-container {
    padding: 1.5rem;
  }

  .form-title {
    font-size: 1.25rem;
  }
}

.form-input:focus,
.form-textarea:focus,
.radio-input:focus + .radio-label,
.checkbox-input:focus + .checkbox-label,
.submit-btn:focus {
  outline: 2px solid hsl(169, 82%, 27%);
  outline-offset: 2px;
}

@media (prefers-contrast: high) {
  .form-input,
  .form-textarea,
  .radio-label,
  .checkbox-custom {
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
