/* Form Styles */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group label .required {
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error {
  border-color: #e74c3c;
}

.form-group input.success {
  border-color: #27ae60;
}

.form-group small,
.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Checkbox Styles */
.checkbox-section {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.checkbox-wrapper:last-child {
  margin-bottom: 0;
}

.checkbox-input {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  margin-top: 0.125rem;
  margin-right: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.checkbox-input:checked {
  background-color: #667eea;
  border-color: #667eea;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.checkbox-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-input:hover:not(:disabled) {
  border-color: #667eea;
}

.checkbox-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label {
  font-size: 0.875rem;
  color: #4b5563;
  font-weight: 400;
  line-height: 1.25rem;
  text-align: left;
  user-select: none;
}

.checkbox-label a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.checkbox-wrapper.checkbox--required .checkbox-label::after {
  content: " *";
  color: #e74c3c;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 0.5rem;
  height: 0.25rem;
  background-color: #e5e7eb;
  border-radius: 0.125rem;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
  width: 33%;
  background-color: #e74c3c;
}

.password-strength-bar.medium {
  width: 66%;
  background-color: #f39c12;
}

.password-strength-bar.strong {
  width: 100%;
  background-color: #27ae60;
}

.password-hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Button Styles */
.btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: #667eea;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #5a67d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #e1e5e9;
  color: #374151;
}

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

.btn-primary .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.btn-primary .spinner.active {
  opacity: 1;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Alert Messages */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* HTMX Indicators */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.spinner {
  border: 2px solid #f3f4f6;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* Divider */
.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e5e7eb;
}

.divider span {
  position: relative;
  padding: 0 1rem;
  background-color: white;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Alternative Link */
.alt-link {
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.alt-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.alt-link a:hover {
  text-decoration: underline;
}

/* Message Styles */
.message {
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.show {
  opacity: 1;
  transform: translateY(0);
}

.message.error {
  background-color: #fee;
  color: #e74c3c;
  border: 1px solid #fcc;
}

.message.success {
  background-color: #e6f7e6;
  color: #27ae60;
  border: 1px solid #b3d9b3;
}