.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(31, 38, 135, 0.15);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.closeBtn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.closeBtn:hover {
  background: rgba(var(--primary-rgb) / 0.1);
  color: var(--primary);
}

.form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.field input,
.field textarea {
  padding: var(--field-padding-y) var(--field-padding-x);
  font-size: var(--field-font-size);
  line-height: 1.4;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.field input {
  min-height: var(--field-height);
}

.field select {
  padding-right: var(--select-padding-end);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.field textarea {
  resize: vertical;
  min-height: calc(var(--field-height) + 24px);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.cancelBtn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.cancelBtn:hover {
  background: rgba(148, 163, 184, 0.15);
}

.submitBtn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb) / 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.submitBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb) / 0.35);
}

.overlayIn {
  animation: overlayFadeIn 0.22s ease forwards;
}

.overlayOut {
  animation: overlayFadeOut 0.22s ease forwards;
}

.modalIn {
  animation: modalFadeIn 0.25s ease forwards;
}

.modalOut {
  animation: modalFadeOut 0.22s ease forwards;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes overlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
