/**
 * @file
 * Visual styles for form components.
 */

/* Form container */
form {
  background-color: #f7f9fc; /* Light grayish-blue background */
  max-width: 100%;
  padding: 1rem;
}

form .field-multiple-table {
  margin: 0;
  width: 100%;
  overflow-x: auto;
}
form .field-multiple-table .field-multiple-drag {
  width: 30px;
  padding-right: 0; /* LTR */
}
[dir="rtl"] form .field-multiple-table .field-multiple-drag {
  padding-left: 0;
}
form .field-multiple-table .field-multiple-drag .tabledrag-handle {
  padding-right: 0.5em; /* LTR */
}
[dir="rtl"] form .field-multiple-table .field-multiple-drag .tabledrag-handle {
  padding-right: 0;
  padding-left: 0.5em;
}
form .field-add-more-submit {
  margin: 0.5em 0 0;
  width: 100%;
}

/**
 * Markup generated by Form API.
 */
.form-item,
.form-actions {
  margin-top: 1em;
  margin-bottom: 1em;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
tr.odd .form-item,
tr.even .form-item {
  margin-top: 0;
  margin-bottom: 0;
}
.form-composite > .fieldset-wrapper > .description,
.form-item .description {
  font-size: 0.85em;
  width: 100%;
}
label.option {
  display: inline;
  font-weight: normal;
}

/* Form labels and required indicator */
.form-composite > legend,
.label {
  display: block;
  font-weight: bold;
  font-size: 1em;
  color: #333;
}

.marker {
  color: #e00;
}

.form-required::after {
  content: "*";
  color: red;
  margin-left: 0.2em;
  font-weight: bold;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 1em;
  margin-bottom: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

select {
  height: auto;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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 1em center;
  background-size: 1em;
  padding-right: 2.5em;
}

.form-item input.error,
.form-item textarea.error,
.form-item select.error {
  border: 2px solid red;
}

/* Button Styling */
button,
input[type="submit"],
.form-actions .btn-primary {
  background-color: #4a90e2; /* Blue background for button */
  color: white;
  padding: 0.8em 1.2em;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
  margin: 0.5em 0;
}

button:hover,
input[type="submit"]:hover,
.form-actions .btn-primary:hover {
  background-color: #357ab7; /* Darker blue on hover */
}

/* Inline error messages */
.form-item--error-message::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  content: "";
  vertical-align: sub;
  background: url(../../images/icons/error.svg) no-repeat;
  background-size: contain;
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
  form {
    padding: 0.5rem;
  }

  .form-item,
  .form-actions {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
  }
  
  .form-composite > .fieldset-wrapper > .description,
  .form-item .description {
    font-size: 0.8em;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="url"],
  textarea,
  select {
    padding: 0.8em;
    font-size: 14px;
  }

  textarea {
    min-height: 100px;
  }

  select {
    padding-right: 2em;
    background-size: 0.8em;
    background-position: right 0.8em center;
  }
}