/**
 * Form styling for Germania theme
 */

/* Enhanced form styling for all elements */
.styled-input-wrapper input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]) {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #ffffff;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.styled-input-wrapper input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.1);
  z-index: 10;
}

.styled-input-wrapper input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"])::placeholder {
  color: #6b7280;
}

/* Textarea styling */
.styled-textarea-wrapper textarea {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #ffffff;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  font-family: inherit;
}

.styled-textarea-wrapper textarea:focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 3px rgba(221, 0, 0, 0.1);
}

/* Select styling */
.styled-select-wrapper select {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.styled-select-wrapper select:focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 3px rgba(221, 0, 0, 0.1);
}

/* File input styling */
.styled-file-wrapper input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.styled-file-wrapper input[type="file"]:hover {
  border-color: #DD0000;
  background-color: #fef2f2;
}

.styled-file-wrapper input[type="file"]:focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 3px rgba(221, 0, 0, 0.1);
}

/* Checkbox and Radio styling */
.styled-checkbox-wrapper input[type="checkbox"],
.styled-checkbox-wrapper input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  color: #DD0000;
  background-color: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.styled-checkbox-wrapper input[type="radio"] {
  border-radius: 50%;
}

.styled-checkbox-wrapper input[type="checkbox"]:checked,
.styled-checkbox-wrapper input[type="radio"]:checked {
  background-color: #DD0000;
  border-color: #DD0000;
}

.styled-checkbox-wrapper input[type="checkbox"]:focus,
.styled-checkbox-wrapper input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(221, 0, 0, 0.2);
}

/* Submit button styling */
.form-actions input[type="submit"],
.form-actions button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #DD0000 0%, #FFD700 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.form-actions input[type="submit"]:hover,
.form-actions button[type="submit"]:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.form-actions input[type="submit"]:focus,
.form-actions button[type="submit"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(221, 0, 0, 0.2);
}

.form-actions input[type="submit"]:active,
.form-actions button[type="submit"]:active {
  transform: translateY(0);
}

/* Hide ALL text format related elements completely */
.filter-wrapper,
.filter-guidelines,
.filter-help,
.text-format-wrapper,
.form-item-body-0-format,
.form-item-field-teaser-0-format,
.form-item-field-lead-0-format,
.form-item-field-description-0-format,
.filter-tips-more-info,
.tips-link,
.filter-help-link,
details[data-drupal-selector*="text-format"],
.text-format-wrapper .tips,
.text-format-wrapper .description a,
/* Hide any format-related form items */
div[id*="edit-body-0-format"],
div[id*="edit-field-teaser-0-format"],
div[id*="edit-field-lead-0-format"],
div[id*="edit-field-description-0-format"],
/* Hide format dropdown and help */
select[name*="[format]"],
.form-item select[id*="format"],
/* Hide all descriptions containing text format links */
.description:has(a[href*="filter"]),
.description:has(a[href*="text-format"]),
/* Hide specific link patterns */
.description a[href*="filter/tips"],
.description a[href*="about-text-formats"],
.description a[href*="text-formats"],
.description a[title*="text format"],
.description a[title*="Text format"],
/* Hide any remaining format elements */
.form-item .description a[href*="/admin/help/filter"],
.form-item .tips,
.form-item .filter-help,
/* Hide entire descriptions that mention text formats */
.description:contains("text format"),
.description:contains("More information about text formats") {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Hide other unwanted form elements */
.form-item-revision,
.form-item-revision-log,
.form-item-path-0-alias,
.form-item-path-0-pathauto {
  display: none !important;
}

/* Error state styling */
.form-item--error .styled-input-wrapper input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]) {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.form-item--error .styled-input-wrapper input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Textarea styling */
.styled-input-wrapper textarea {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #ffffff;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
  resize: vertical;
  min-height: 6rem;
}

.styled-input-wrapper textarea:focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.1);
}

.styled-input-wrapper textarea::placeholder {
  color: #6b7280;
}

/* Select styling */
.styled-input-wrapper select {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.75rem;
  padding-right: 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
}

.styled-input-wrapper select:focus {
  outline: none;
  border-color: #DD0000;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.1);
}

/* Checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  color: #DD0000;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: #DD0000;
  border-color: #DD0000;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.2);
}

/* Form labels */
.form-item__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-required {
  color: #dc2626;
  margin-left: 0.25rem;
}

/* Form descriptions */
.description {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Form errors */
.form-item--error-message {
  font-size: 0.875rem;
  color: #dc2626;
  margin-top: 0.5rem;
}

/* Button styling override for forms */
.user-register-form input[type="submit"],
.user-login-form input[type="submit"],
.user-pass-form input[type="submit"] {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #DD0000;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.user-register-form input[type="submit"]:hover,
.user-login-form input[type="submit"]:hover,
.user-pass-form input[type="submit"]:hover {
  background-color: #b91c1c;
}

.user-register-form input[type="submit"]:focus,
.user-login-form input[type="submit"]:focus,
.user-pass-form input[type="submit"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.2);
}

.user-register-form input[type="submit"]:active,
.user-login-form input[type="submit"]:active,
.user-pass-form input[type="submit"]:active {
  background-color: #991b1b;
}

/* Form validation messages */
.messages {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

.messages--error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.messages--warning {
  background-color: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
}

.messages--status {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}