/**
 * @file
 * Styles for the barcode address form.
 *
 * Colors match the Faigle theme variables:
 * - Gold: #bd9b08
 * - Dark blue: #05265e
 * - Black: #04071a
 * - Grey dark: #757786
 * - Grey light: #f2f4f6
 */

/* Form Container */
.barcode-address-form {
  font-family: "ABC Whyte", sans-serif;
}

/* Form Items */
.barcode-address-form .form-item {
  margin-bottom: 1rem;
}

.barcode-address-form label {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.5rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #04071a;
}

.barcode-address-form label.form-required::after {
  content: " *";
  color: #bd9b08;
}

/* Text Inputs */
.barcode-address-form input[type="text"],
.barcode-address-form select {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid #757786;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  font-family: "ABC Whyte", sans-serif;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.barcode-address-form input[type="text"]:focus,
.barcode-address-form select:focus {
  outline: none;
  border-color: #bd9b08;
  box-shadow: 0 0 0 2px rgba(189, 155, 8, 0.2);
}

/* Select Dropdown */
.barcode-address-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757786' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  padding-right: 2.5rem;
  min-height: 45px;
}

/* Submit Button */
.barcode-address-form .form-actions {
  margin-top: 1.5rem;
}

.barcode-address-form input[type="submit"],
.barcode-address-form .barcode-submit-button {
  font-family: "ABC Whyte", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.75rem;
  font-weight: 500;
  padding: 0.625rem 2rem;
  width: 100%;
  border: none;
  display: block;
  text-align: center;
  border-radius: 0.375rem;
  background-color: #bd9b08;
  background: linear-gradient(45deg, #bd9b08 50%, #04071a 50%);
  background-size: 285%;
  background-repeat: no-repeat;
  background-position: top left;
  transition: background-position 0.5s ease;
  color: #fff;
  cursor: pointer;
}

.barcode-address-form input[type="submit"]:hover,
.barcode-address-form .barcode-submit-button:hover {
  background-position: top right;
}

.barcode-address-form input[type="submit"]:focus,
.barcode-address-form .barcode-submit-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(189, 155, 8, 0.4);
}

/* Error States */
.barcode-address-form .form-item--error input,
.barcode-address-form .form-item--error select {
  border-color: #dc3545;
}

.barcode-address-form .form-item--error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Maxlength Feedback */
.barcode-address-form .maxlength-feedback {
  font-size: 0.8125rem;
}

.barcode-address-form .maxlength-feedback.maxlength-reached {
  color: #bd9b08;
  margin-top: 0.25rem;
}

/* Messages */
.barcode-address-form .messages {
  margin-bottom: 1rem;
  border-radius: 0.25rem;
}

.barcode-address-form .messages--error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.barcode-address-form .messages--status {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Success message - fix broken checkmark */
.barcode-address-form .messages--status::before {
  content: none;
}

/* Loading State - AJAX Progress */
.barcode-address-form .ajax-progress {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.barcode-address-form .ajax-progress .throbber,
.barcode-address-form .ajax-progress-throbber .throbber {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #f2f4f6;
  border-top-color: #bd9b08;
  border-radius: 50%;
  animation: barcode-spinner 0.8s linear infinite;
  margin-right: 0.5rem;
  background: none;
  /* Reset any default throbber background */
  background-image: none !important;
}

.barcode-address-form .ajax-progress-throbber {
  display: inline-flex;
  align-items: center;
}

/* Hide default throbber message if any */
.barcode-address-form .ajax-progress .message {
  font-size: 0.875rem;
  color: #757786;
}

@keyframes barcode-spinner {
  to {
    transform: rotate(360deg);
  }
}
