/**
 * @file
 * Donation form styling.
 */

/* Donation intro text - shown only on the Amount step */
.donation-intro {
  width: 100%;
}

.donation-intro__title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0 0 1.5rem;
  letter-spacing: 0.05em;
}

.donation-intro__text p {
  font-size: 1.6rem;
  line-height: 1.7;
  color: #495057;
  margin: 0 0 1.2rem;
}

.donation-intro__text p:last-child {
  margin-bottom: 0;
  font-weight: 500;
  color: #1a2a3a;
}

@media (max-width: 768px) {
  .donation-intro {
    padding: 2rem;
    margin-bottom: 2rem;
  }

  .donation-intro__title {
    font-size: 2rem;
  }

  .donation-intro__text p {
    font-size: 1.4rem;
  }
}

/* Main donation form container */
.donation-form {
  /* max-width: 800px; */
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
}

/* Push content below fixed header for anonymous users.
   --header-height (8.4rem=84px) + --admin-toolbar-size (39px) = 123px,
   matching the offset used on normal content pages. */
body:not(.page--logged-in) form.donation-form {
  margin-top: calc(var(--header-height) + var(--admin-toolbar-size));
}

.donation-form>.webform-title-header {

  margin: 0 auto;
  padding: 50px 0px;
  /* max-width: 120rem; */
}

#edit-select-an-amount-other {

  max-width: 900px;
  margin: 0 auto;
  margin-top: 20px;
}

#edit-select-an-amount::after {
  display: none;
  ;
}

.donation-form .inputbox {
  flex-direction: column;
}


/* Form steps */
.step-pane {
  display: none;
  padding: 30px;
  animation: fadeIn 0.3s ease-in-out;
}

.step-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Step titles */
.step-pane h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 24px;
  font-weight: 300;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

/* Progress indicator */
.progress-indicator {
  display: flex;
  justify-content: space-between;
  background: #f8f9fa;
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 15px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.completed::after {
  background: #28a745;
}

.progress-step .step-number {
  width: 30px;
  height: 30px;
  line-height: 30px;
  background: #dee2e6;
  color: #6c757d;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.progress-step.active .step-number {
  background: #3498db;
  color: #fff;
}

.progress-step.completed .step-number {
  background: #28a745;
  color: #fff;
}

.progress-step .step-label {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  color: #6c757d;
}

.progress-step.active .step-label {
  color: #3498db;
  font-weight: 500;
}

/* Amount selection */
.amount-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.amount-btn {
  padding: 15px 20px;
  border: 2px solid #dee2e6;
  background: #fff;
  color: #495057;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.amount-btn:hover {
  border-color: #3498db;
  color: #3498db;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.amount-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.amount-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.amount-btn.active:hover {
  background: #2980b9;
  border-color: #2980b9;
}

/* Custom amount input */
.custom-amount-container {
  max-width: 300px;
}

.custom-amount-container label {
  display: block;
  margin-bottom: 10px;
  color: #495057;
  font-weight: 500;
}

#manual-amount {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 18px;
  text-align: center;
  transition: border-color 0.3s ease;
}

#manual-amount:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Form fields */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-weight: 500;
}

.required::after {
  /* content: ' *';
  color: #dc3545; */
  display: none;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control.error {
  border-color: #dc3545;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
}

/* Company checkbox */
.company-check-container {
  margin: 25px 0;
}

#company-check {
  margin-right: 10px;
  transform: scale(1.2);
}

/* Company name field visibility is handled by states API, not CSS */

/* Country warning */
#country-warning {
  margin-top: 10px;
  padding: 15px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  color: #856404;
}

#country-warning i {
  margin-right: 8px;
}

/* Review section */
.review-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.review-section h4 {
  color: #495057;
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 8px;
}

.review-section p {
  margin: 8px 0;
  color: #6c757d;
}

/* Terms and reCAPTCHA */
.terms-container {
  margin: 20px 0;
}

#terms-agree {
  margin-right: 10px;
}

#recaptcha-container {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  min-height: 78px;
}

.recaptcha-loading {
  padding: 20px;
  color: #666;
  font-style: italic;
}

/* Processing area */
.loading {
  text-align: center;
  padding: 40px;
}

.loading img {
  margin-bottom: 15px;
}

.loading p {
  font-size: 18px;
  color: #6c757d;
}

/* Navigation buttons */
.form-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.btn {
  padding: 10px 25px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: #3498db;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #2980b9;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
}

/* Error messages */
.alert {
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Return messages – relocated inside the form, below the title */
.donation-return-message {
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

.donation-return-message .alert {
  font-size: 1.6rem;
  line-height: 1.6;
}

.donation-return-message .alert-danger {
  background: #fce4e4;
}

.donation-return-message .alert-warning {
  background: #fff8e1;
}

.donation-return-message .alert-success {
  background: #e8f5e9;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .donation-form {
    /* margin: 0 15px; */
  }

  .step-pane {
    padding: 20px;
  }

  .amount-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .progress-indicator {
    padding: 15px 20px;
  }

  .progress-step .step-label {
    font-size: 12px;
  }

  .form-navigation {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }

  .form-navigation .btn {
    width: 100%;
    order: 2;
  }

  .form-navigation .prev-btn {
    order: 1;
  }
}

@media (max-width: 480px) {
  .amount-buttons {
    grid-template-columns: 1fr;
  }

  .progress-step .step-label {
    display: none;
  }

  .step-pane h3 {
    font-size: 20px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 18px;
  }
}

/* Animation for button clicks */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

/* Edit buttons in review step */
.edit-btn {
  background: none;
  border: none;
  color: #3498db;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
}

.edit-btn:hover {
  color: #2980b9;
}

/* Retry button */
.retry-btn {
  margin-top: 15px;
  background: #ffc107;
  color: #212529;
}

.retry-btn:hover {
  background: #e0a800;
}

/* CSS Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Inline checkbox and label alignment */
.form-item--inline-label {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.form-item--inline-label .form-item__wrapper {
  display: flex !important;
  align-items: center !important;
  flex: 1 !important;
}

.form-item--inline-label input[type="checkbox"] {
  margin: 0 !important;
  margin-right: 8px !important;
}

.form-item--inline-label .form-check-label {
  margin: 0 !important;
  font-weight: normal !important;
  line-height: 1.4 !important;
}

.webform-element-description,
.description.form-item__description.description--after>ol {
  padding-left: 25px;
}

/* Ultra high specificity to override theme styles */
.is-supporter {
  font-size: 2.2rem;
  flex-wrap: wrap;
}

.is-supporter ol {
  padding-left: 2rem;
  font-size: initial;
  margin-top: 0.1rem;
}

.is-supporter li {
  margin-bottom: 0.5rem;
}

.is-supporter .form-check__label {
  margin-bottom: 0;
}

.is-supporter:hover {
  background: none !important;
}

.summary-field {
  margin: 0;
}

.form-item-summary {
  margin-bottom: 5rem !important;
  line-height: 0.2rem;
}

.captcha-type-challenge--recaptcha {
  margin-bottom: 2rem;
}

.donation-checkbox__input {
  width: 2.3rem;
  height: 2.3rem;

}


.form-item-select-an-amount-radios>.error {
  background: none !important;
}

.webform-submission-donation-form input[data-drupal-selector="edit-select-an-amount-other"].error,
.webform-submission-donation-add-form input[data-drupal-selector="edit-select-an-amount-other"].error {

  background-image: none;
  margin-top: 20px;
}

form[data-drupal-selector="webform-submission-donation-add-form"] label[for="edit-agree"] {
  white-space: normal !important;
}