:root {
  /* Forms-specific colors */
  --aidan-form-bg: rgba(11, 21, 35, 0.85);
  --aidan-form-border: rgba(136, 186, 240, 0.25);
  --aidan-form-focus: rgba(136, 186, 240, 0.9);
}

/* ===== BOOTSTRAP MODAL OVERRIDES ===== */

.modal-dialog {
  animation: modalFadeIn 0.4s ease-out;
  position: relative;
  z-index: 1100;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-backdrop {
  background-color: rgba(5, 10, 25, 0.7);
  backdrop-filter: blur(8px);
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-content { 
  border-radius: 24px; 
  border: 2px solid rgba(100, 180, 255, .4);
  color: #ecf4ff;
  box-shadow: 
    0 20px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(50, 120, 255, 0.2),
    inset 0 1px 1px rgba(150, 200, 255, 0.1);
  backdrop-filter: blur(15px);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(8, 22, 50, .99), rgba(5, 15, 40, .98));
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 92'%3E%3Cg opacity='0.12' stroke='%237dd4ff' stroke-width='1.5' fill='none'%3E%3Cpath d='M20 10 L40 0 L60 10 L60 30 L40 40 L20 30 Z'/%3E%3Cpath d='M20 50 L40 40 L60 50 L60 70 L40 80 L20 70 Z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(8, 22, 50, .99), rgba(5, 15, 40, .98));
  background-size: 200px 230px, auto;
  background-position: 0 0, 0 0;
  background-repeat: repeat, no-repeat;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 212, 255, 0.8), transparent);
}

.modal-header {
  border-bottom: 1px solid rgba(100, 170, 255, .25);
  padding: 1.8rem 1.8rem 1.5rem;
  background: linear-gradient(180deg, rgba(50, 100, 180, 0.1), transparent);
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 180, 255, 0.3), transparent);
}

.modal-title {
  font-weight: 700;
  font-size: 1.4rem;
  color: #e8f0ff !important;
  background: linear-gradient(90deg, #7dd4ff, #c4e1ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 2rem 1.8rem;
  background: linear-gradient(180deg, rgba(20, 45, 90, 0.05), rgba(10, 25, 55, 0.05));
}

.form-label {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: .98;
  margin-bottom: 0.65rem;
  color: #c4e1ff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.form-control, .form-select { 
  background: linear-gradient(145deg, rgba(12, 28, 60, .95), rgba(8, 18, 45, .95)) !important; 
  border: 2px solid rgba(100, 160, 255, .35) !important; 
  color: #f4f8ff !important;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  transition: all .3s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239dd4ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

.form-select option {
  background: #0f1e40;
  color: #f4f8ff;
  padding: 0.5rem;
}

.form-select option:checked {
  background: linear-gradient(#5b9fff, #5b9fff) #0f1e40;
}

.form-control::placeholder {
  opacity: 1 !important;
  color: #ffffff !important;
}

.form-control:focus, .form-select:focus { 
  border-color: #7dd4ff; 
  box-shadow: 
    0 0 0 0.25rem rgba(125, 212, 255, .35),
    inset 0 2px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(145deg, rgba(25, 55, 100, .98), rgba(18, 40, 80, .98));
  color: #f4f8ff;
  outline: none;
}

/* Required field indicator */
.form-label span {
  color: #ff8787;
}

/* Better focus states for accessibility */
button:focus-visible {
  outline: 2px solid #7dd4ff;
  outline-offset: 2px;
  border-radius: 6px;
}

a:focus-visible {
  outline: 2px solid #7dd4ff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form validation states */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #ff6b6b;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 .3rem rgba(255, 107, 107, .25);
}

.invalid-feedback {
  color: #ff8787;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
}

.modal-footer { 
  border-top: 1px solid rgba(100, 170, 255, .25);
  padding: 1.5rem 1.8rem;
  gap: 0.75rem;
  background: linear-gradient(180deg, transparent, rgba(30, 70, 140, 0.1));
  position: relative;
}

.modal-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 180, 255, 0.3), transparent);
}

.btn-light-subtle { 
  color: #d5e6ff; 
  background: linear-gradient(145deg, rgba(100, 150, 255, .15), rgba(80, 130, 255, .08)); 
  border: 1.5px solid rgba(125, 180, 255, .4);
  font-weight: 600;
  transition: all .3s ease;
}

.btn-light-subtle:hover { 
  background: linear-gradient(145deg, rgba(125, 180, 255, .25), rgba(100, 160, 255, .15));
  color: #f4f8ff;
  border-color: rgba(150, 200, 255, .6);
  box-shadow: 0 0 15px rgba(125, 180, 255, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, #5b9fff 0%, #3b7fff 100%);
  border: 1.5px solid rgba(125, 180, 255, .6);
  color: #fff;
  font-weight: 700;
  padding: 0.75rem 1.8rem;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 rgba(91, 159, 255, 0);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7eb3ff 0%, #5b9fff 100%);
  transform: translateY(-3px);
  box-shadow: 
    0 10px 30px rgba(91, 159, 255, .6),
    0 0 20px rgba(125, 212, 255, 0.5);
  border-color: rgba(150, 210, 255, 1);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-primary.loading {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-close {
  filter: brightness(180%) invert(0.85) !important;
  opacity: 0.9 !important;
}

.btn-close:hover {
  filter: brightness(220%) invert(0.9) !important;
  opacity: 1 !important;
}

/* Form styling (used in modals) */

.aidan-form {
  display: grid;
  gap: 1rem;
}

.aidan-form-label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.85);
  margin-bottom: 0.4rem;
}

.aidan-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--aidan-form-border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--aidan-white);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.aidan-input:focus {
  border-color: var(--aidan-form-focus);
  box-shadow: 0 0 0 4px rgba(136, 186, 240, 0.22);
}

.aidan-form-fieldset {
  border: 1px solid var(--aidan-form-border);
  border-radius: 1rem;
  padding: 0.9rem 1rem 0.7rem;
  margin: 0;
}

.aidan-form-fieldset legend {
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.aidan-form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.9);
}

.aidan-form-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: rgba(136, 186, 240, 0.95);
}
